Some help for inexperinced VBA users

Lo Lun To

New Member
Joined
May 9, 2002
Messages
8
I see a great number of requests on this board for VBA code that can be obtained merely by running the macro recorder.

Before posting requests for macro code, try the macro recorder.
This may result in your question to this board being unnecessary.
In addition, your VBA knowledge is likely to be more enhanced by having found the code yourself, rather than being supplied by others.

Persons who are experienced with VBA frequently use the macro recorder to get code.
Many of the answers supplied to the many simple VBA questions on this board are most likely obtained from the macro recorder.
 
Where is this "test" macro situated? In a module in the same workbook? It should work, unless "test" is declared like this:<pre>
Private Sub test()</pre>

If it is, change "Private" to "Public".

Or, if the macro isn't too long (I don't usually suggest this) just copy and paste the code into the "WorkBook_Open" event.

_________________<font color = green> Mark O'Brien
This message was edited by Mark O'Brien on 2002-05-10 08:23
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Change the line test to:

Application.Run ("KKMacros.xls!activepath")

where KKMacros.xls is the name of your personal macro workbook and activepath is the name of the macro you want to run.

As for auto scheduling, I believe you can use windows scheduling to handle this. I've not used it so cannot give much more info...

K
 
Upvote 0
You can call the private procedure from an event procedure if you call it the long way:

Code:
Application.Run ("test")
 
Upvote 0
Defeats the purpose of "Private" if you ask me then. (but let's not bicker about MS's philosophy, there are better things to bicker about, like animated smilies. :biggrin: )
 
Upvote 0
Not to be too arguementative :biggrin:, but, I think it depends who/what you want the procedure to be sheilded from, not your procedures, but from the macro dialog box.

The windows task scheduler works fairly well. I've used it to launch excel on LAN login, which should fire a workbook_open procedure (not an auto_open procedure). Also, you can place files or shortcuts to files in your xlstart folder to launch upon Xl's launch.
 
Upvote 0
Hard to say from Minneapolis. Did it work?

You can record opening the file and saving it as something else (e.g., a cell value, a certain name, etc...) But you can record the workbook_open macro that calls the recorded macro from your personal.xls file. See Mark's post earlier on where to put it and the posts above on calling it

application.run("personal.xls!MacroName")


_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
wave.gif

This message was edited by NateO on 2002-05-10 09:06
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top