• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 31. Advanced VBA Programming > Common Problems and Solutions

Common Problems and Solutions

Q1:I'm working on a custom form in the VBE, and there's not enough room to display the whole form.
A1: The VBE has a very busy screen, especially if you have all the optional windows open. Try closing some of the windows, such as the Project Explorer, the Immediate window, and the Properties window. You can open them again when you need them.
Q2:I wrote some great code for one of my workbooks. How can I use it in another workbook?
A2: Open both workbooks in Excel and open the VBE. The Project Explorer shows all the modules in all open workbooks. You can drag modules from one workbook to another to duplicate the code.
Q3:I had written some event code for a control in a form, but then I deleted the control from the form. Did I lose my work?
A3: No. Look in the General section of the form's code module. The procedures for deleted controls are stored there.
Q4:I wrote some VBA macros for Excel 5.0 that used Windows API calls. Now they don't seem to work. What went wrong?
A4: Excel 5.0 was designed to run in the 16-bit versions of Windows. Excel 7.0 and Excel 97 (8.0) are designed to work with Windows 95 and Windows NT, both of which are 32-bit operating systems. Almost every Windows API function was redefined for 32-bit Windows, and the code has to be rewritten. At a minimum, you'll have to correct the declarations of the functions. You might also have to change the data types of any variables or other data that you pass as arguments to the functions.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint