Delete a macro with a macro

G

Guest

Hi All.........
I need the code, if someone pleases, on how to delete or disable my

Private Sub Workbook_Open() macro

TIA
Vaya con Dios,
Chuck, CABGx3
 
G

Guest

A couple of issues.........
1- Chips procedures require setting a reference to the "Microsoft Visual
Basic for Applications Extensibility" library......(not the 5.3
version)......I do not have that option showing.......I tried the 5.3 one
which I do have, and it worked sometimes but would not stay checked through a
save and re-open. Is this a MIS "rights" and/or not everything installed
thing?

2- Assuming I do get the proper library checked, does that mean that
everyone who uses this file will have to do the same thing?......if so, can
it be done programatically, within this file?


TIA
Vaya con Dios,
Chuck, CABGx3
 
G

Guest

Hi Chuck,
Chip does it the right way but John Walkenbach has also suggested another
way precisely because of the "does that mean that everyone who uses this file
will have to do the same thing?" issue.
If you declare your variables as Object, Excel will figure out what kind
of object it is at run time. So, EXAMPLE: instead of declaring...
Dim cmThisWorkbook as CodeModule
try
Dim cmThisWorkbook as Object

etc, etc, etc...

HTH,
 
G

Guest

Thanks Gary.......
I'll try that tomorrow........it's wuitting time in St. Petersburg, Fla.
I beat my current requirement by wrapping my Workbook_Open macro in an IF
statement and changing one cell in the new file.....just keeping the
Workbook_Open in both, but it performs differently in each because of the
changed cell...........not proper, but I was in a hurry..........I still want
to know how to "do it right" tho.......


Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top