Archive for the ‘Visual Basic Editor’ Category.

VBA Framework II

See VBA Framework for the first revision.
For this revision, you can select which VBProject in which to add the code and you can identify a parent class.

I refactored the code to use a class module to make the code more readable. Concatenating strings is always messy, so I hope this helps a little. [...]

VBA Framework

In Create Classes… I had this todo list:

Create the class module rather than copy and paste
Name the class module based on the table name
Select the database and table from a list on a userform
Establish Parent Child relationships between two classes
Create functions to fill the class from a recordset
Create a userform to add/edit/delete records

I need to [...]

Using the Object Browser

Mathew asks:
Where do you find the field names for Outlook, i.e. FirstName. Yours are practically about the only ones I can get to work. Strangely, I can’t get Business Phone (s) or faxes to work.
The answer: Use the object browser. Here’s how. First, make sure you have a reference set to the Outlook [...]

Missing VBE Toolbars

There are some days that I feel like I’m using Excel for the first time. Yesterday was one of them. The menu and toolbars were gone from the Visual Basic Editor. View > Toolbars didn’t work. I couldn’t right click on anything to Customize the toolbars. From the Immediate Window, [...]

More Dueling Banjos

I tried to use EnableCancelKey to allow myself to stop the music and still make the appropriate API calls to reset the midi out. It didn’t work so well for me. Here’s another way.
I created two global variables. One to determine whether the procedure was already running and one to determine if [...]

EnableCancelKey

The EnableCancelKey property of the Application object determines what will happen when a user interrupts your code. Users can interrupt code by pressing Esc or Cntl+Break. EnableCancelKey has three possible settings:

xlDisable - Prevents the user from interrupting. I’ve never used this and can’t think of why I ever would.
xlInterrupt - Normal operation. [...]

VBA Editors

fzz sez:
Lipstick on a warthog.
That a thing CAN be done doesn’t make it a good idea. VBE is a handy debugging environment, but it’s not a particularly good editor. Myself, if I need to do thorough editing of VBA code, I write it to text files, use a more capable editor, then read it back [...]

Excel VBE Multiline Search And Replace

I’m a full time Excel developer.
That means I spend quite some time writing code in the Visual Basic Editor (VBE).
I don’t maintain a real code library, but I do copy lots of code from previous projects into new ones.
Whereas the VBE is quite a nice application to write code in, it does lack some functionality [...]