Answer Questions
jitendra badkas Loop causing MS Word freeze
I tried to run a simple loop I created as a macro employing a user form that contains a label and a command button. I want the label caption to alternate between OFF and ON as the command button is clicked. There must have been an error of some sort as when I ran the macro it froze MS Word completely. No compile error ever appeared and the macro DID begin to run without protest. I looked at the task manager and everything under MS Word was "not responding". I ended the macro under the task manager and MS Word completely shut down! Here is the code. I realize it is not structured correctly, but should trying to run it cause MS Word to to freeze up and require a shut down via the task manager Surely it can't have creat ...Show All
kate1p1 How can I be gold partner
Our company is ISV partner. How can we be gold partner. I read all the information from partner website. I need short summery of that. The short answer is certify your applicaiton and register your references (3 minimum) then you get on the map for gold partner. FOr more info i wrote a book called "Partnering with Microsoft". Ted Dinsmore ...Show All
Kevin8264 Run time error 1004
I am attempting to delete a range of cells in an Excel spreadsheet using a Macro. The range is one row by 8 columns. However, when the line of VBA code actually doing the deletion is reached I get a "Run-time error '1004': Delete method of Range class failed." The actual line causing the error is: Selection.Delete Shift:=x1Up where I have previously selected the range. All of the cells in the range do have data and I have security set to the lowest level. The line causing the error was obtained by recording a macro on another sheet and this was the code generated. I also tried another variation, which was Range(strSort).Delete Shift:=x1Up but got the same error. The section of cod ...Show All
Tom Avogardo reformat TOC (table of content) and write it to text file
Hi, I'd like to read the TOC starting from below "Part II test cases" until the end of TOC. After that, I need reformat the TOC hierarchy in the format like example below and finally write the result to a text file. Example: TOC in Ms Word Part II Test Cases 7 1 Schedule Document 7 1.1 Cleanup instance after scheduling. 7 1.2 WebI Specific Scheduling. 8 1.3 Document Format 9 2 Schedule to printer 9 2.1 Collate option for Crystal Report 9 3 Default Destination. 11 3.1 Alter the object destination to default destination. 11 3.2 Schedule to Default Destination. 12 Text file format: (wanted) 1=/Schedule Document 2=/Schedule Document/Cleanup instance after scheduling 3=/Schedule Document/WebI Specif ...Show All
Serge2k Refer to another module tag
I have a small problem that is of greate importance to me and seem to have a hard time getting any help. I have two modules. in the first module i have code that creates buttons. if a button is pressed then a sub in ANOTHER module is called. that works fine. in that sub i want to check which button has been pressed. therefore i need to look at the tag for the button. it is here that my code fails. i do not know how to do this when the button is created in another module than the sub. that is all i am asking. My code for the first module: Public Sub Create_Menu() Dim MyBar As CommandBar Dim MyPopup As CommandBarPopup Dim linjeDiagramKnapp As CommandBarButton Dim stapelDiagramKnapp As CommandBarButton 'stapeldiagramknapp Set s ...Show All
Daudi Integer inside a MsgBox? (VBA Access 2000)
Is it possible to place an integer inside a MsgBox I want to cue the user to add "x" pages of labels before printing this report (labels)... with x referring to the number of pages of the report. Thanks! Your probably going to need to convert it to a string Example dim i as integer = 1 msgbox("Test Text" & cstr(i)) But as said this is not the forum for VBA questions. VBA Forums http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=74&SiteID=1 These forums aren't for VBA questions... But the short answer is yes, you can create a string using a variable something like: "Be sure to add " & x & " pages of labels bef ...Show All
Mr Pro Tools Mac Pc compatibility with Excel VB
I have a program I wrote in Excel VB that I want to be able to run on a Mac. However when ever I open the workbook on a Mac many of the user forms come up blank, and most of the string functions are undefined. specifically mid() and chr() functions. When I start a new program from scratch on the Mac the mid() functions work just fine. Is it possible to resolve these issues or are these lower level functions not compatible between both systems. PC excel vertion = Microsoft Excell 2002 (10.2614.2625) Mac vertion = Office X for mac The error isn't in the string functions. The problem is with some other library or command which is not valid in Mac VBA. I've found that the strings library acts as t ...Show All
PaoloZ Microsoft Office Document Image Writer -- partial print
Hello, I couldn't find this on the forum, so I'm hoping someone can help. I have a Publisher document that I'm merging with an excel mailing list. My printing-guy likes to use .mdi files, so usually I just do the merge, print to .mdi, and e-mail him the resulting document. For some reason, when I'm writing the .mdi file, it won't save the whole big merge into one document -- instead it wants to save it multiple times. For example, I have 1000 records that are being merged to post-card addresses. The front of each postcard is the same. The back is the merge area. When I merge-to-print and select the "Microsoft Office Document Image Writer" as the printer, it'll go to the "save-as" window like normal. Once I click s ...Show All
a.i. Error handling problem
Hi - i have an end of month routine that will run - however it brings up error 3021: no current record. this occurs if the user presses the command button where they have not entered any activity that is greater than the 'datelastsubmitted' date because the form loads with the following code: Private Sub Form_Load() Me!officer.SetFocus officer.Value = loginname Me.submit.Enabled = False Dim rsdbase As Database Dim rstemp As Recordset Set rsdbase = CurrentDb Set rstemp = rsdbase.OpenRecordset("SELECT SUM(activityhours)AS [availablehours] FROM [qryavailablehours]WHERE [loginname] ='" & CStr(Me.officer.Value) & "'") With rstemp .MoveFirst Me.availablehours = Format(Nz(!availablehours, ...Show All
Debbie M MS Office document and image writer print driver
Besides removing this feature from Office during setup, is there a process to remove this virtual printer from 300 users with roaming profiles on an active directory network We are having an issue with this printer assuming the "default printer" selection for our users. As a work around we have changed their default printer, but after they reboot or log off / on it has defaulted back to the MS Ofc doc and image writer printer. A little bit different problem here. I was using this Microsoft Document Imaging Writer port (virtual printer) for quite some time to print what ever screen/file into a image file (mdi/tif format). This virtual printer was missing from the printer folder without I noticed ...Show All
NorCis RecordSet problem
Hi, I have problem retrieving data from MS SQL server to Excel. Let me describe what I am trying to do and hopefully the experts out there could help. First of all, I have some data stored in MS SQL Server. I am trying to create a user interface in Excel using VBA. The users would choose some criteria using VBA forms and I hope to pass these criteria to SQL Server and run a stored proc. The stored proc would process the data using this set of criteria and return the required data back to Excel spreadsheet. My first question is, will this work if my stored proc creates a temp table and at the end of the stored proc the data being returned to Excel is from this temp table. I have this in mind because the stored proc is doing fine ...Show All
vb2005 Library Reference issues.
Hello guys, I am building my Excel macros using Excel11.0 library. I only use the syntax that works on Excel 2000, so that my code runs on Excel 2000. So far, my code is created in Excel 2003 editor and runs on both Excel 2003 and Excel 2000. But if I am referencing another office library like Outlook 11.0 Object in my excel macro, Excel 2000 can't pick up the library. I am creating my macro using Office2003, but there are some computers in my company uses Office2000. And you know upgrading their office is out of my reach. What should I do Thank you. Thanks for the reply. So, I have to have two copies. T___T sob. Go to one of the Office 2000 machines and ope ...Show All
Shohre Mansouri Sending e-mail from within VBA
We have an application that makes heavy use of the capability to send out email. The application is written in Access, and we use the local Outlook client to send mail through the client's Exchange server. This has worked fine so far. However we now have a need to send email from the same machine, but make it look like it came from a different account (i.e. email sender). In realtime Outlook, you can define multiple accounts in your Outlook profile and can easily switch between them, so that the From address reflects the underlying account set up. After hours of searching, it seems that from vba you can control almost everything about an e-mail EXCEPT make it send from a different account. Any Ideas Thanks, -Rob ...Show All
Saptagiri Tangudu IsError function from VBA6.3 to v6.0
Hi All, I'm having problems with a small VBA script that I wrote in v6.3 but need to implement in 6.0. Excel 2002 -> 2000. The following code works fine in the later version: For i = 2 To LastRow ' select the next row based on loop vString = "A" & i If IsError(Application.VLookup(Range(vString).Value, vRange, 31, False)) Then Y = "NEW" Else Y = Application.VLookup(Range(vString).Value, vRange, 31, False) End If ' write the result to the active workbook Cells(i, 31).Value = Y Next i But won't work in the earlier version as there's a type mismatch at the If Iserror ... line. Any ideas why or thoughts on a workaround Thanks, Steve. ...Show All
arkiboys Future of VBA (and VBScript)?
We developped a number of tools in VBA or VBScript, sometimes using COM objects, and the large compatibility of VB, VBA and VBScript was certainly nice. We would no mind moving to .NET (the framework API being quite interesting), but it is not clear what is going to be the future for VBA and VBScript. Can we expect a VB.NET"A" and a VB.NET"Script" I need to develop excel solutions which work for windows and os x. what script language / other possibility do you suggest seems that vba support for os x is discontinued from office 2008 on... So your X and Y seem not to far away thanks for any suggestions! simon I am unclear on what the migration or future is for applic ...Show All
