Mach1pro
asked on
How to read contents of Macros using VBA
How can I use VBA to view the actions and arguments within a macro?
I don't know about VBA, but you can put it in a word document with the documenter (tools, analyze, documenter).
On the macro tab, click options and check the actions and arguments (uncheck the others if you don't want to know) and select the macros you want to see.
I hate macros, they're a pain to debug, so I try to rewrite them all in code using this document when I get a new application to rewrite.
On the macro tab, click options and check the actions and arguments (uncheck the others if you don't want to know) and select the macros you want to see.
I hate macros, they're a pain to debug, so I try to rewrite them all in code using this document when I get a new application to rewrite.
Hi Mach1pro
What you can do is highlight the macro then click on Tools > Macro > Convert Macro to Visual Basic
This will create a module and convert the macro to VBA.
You can then go into the module and see all the VBA commands used in the macro.
Hope this is what you are trying to do.
What you can do is highlight the macro then click on Tools > Macro > Convert Macro to Visual Basic
This will create a module and convert the macro to VBA.
You can then go into the module and see all the VBA commands used in the macro.
Hope this is what you are trying to do.
ASKER
ReneJ,
Find me a way to do those same steps using VBA code (NO SEND KEYS) and then I can make the rest of it work. Remember my question was how to see the Macro using VBA.
Find me a way to do those same steps using VBA code (NO SEND KEYS) and then I can make the rest of it work. Remember my question was how to see the Macro using VBA.
ReneJ - I don't think you're going to get an answer as I don't think its possible...
it's probably not what you want but it is a start...
DoCmd.RunCommand acCmdConvertMacrosToVisual Basic
DoCmd.RunCommand acCmdSaveModuleAsText
can't figure out a way to select the macro you want to use or to select the right module
You could ofcourse convert all your macro's to VBA and then only use the save module as text (but still find out a way to get the right module)
You can start up the documenter with VBA code (docmd.RunCommand acCmdDocumenter), but you cannot pass any arguments so basically I think it is not possible, but maybe this will point you in a possible direction.
DoCmd.RunCommand acCmdConvertMacrosToVisual
DoCmd.RunCommand acCmdSaveModuleAsText
can't figure out a way to select the macro you want to use or to select the right module
You could ofcourse convert all your macro's to VBA and then only use the save module as text (but still find out a way to get the right module)
You can start up the documenter with VBA code (docmd.RunCommand acCmdDocumenter), but you cannot pass any arguments so basically I think it is not possible, but maybe this will point you in a possible direction.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Administrative Action - Force Accepted.
SpideyMod
Community Support Moderator @Experts Exchange
SpideyMod
Community Support Moderator @Experts Exchange
Spideymod, what triggered the Force Acceptance?
Cheers, Andrew
Cheers, Andrew
TextReport,
I'd rather not say, I'll let Mach1pro divulge that if desired.
SpideyMod
Community Support Moderator @Experts Exchange
I'd rather not say, I'll let Mach1pro divulge that if desired.
SpideyMod
Community Support Moderator @Experts Exchange
OK
ASKER
I don't know either unless it's just the fact that the question has gotten stale. No ever did supply an answer that would work using VBA. Maybe this idea isn't even possible.
Mach1pro,
If you truly do not know, I can provide the information here, I'm just trying to protect your privacy wherever I can.
SpideyMod
Community Support Moderator @Experts Exchange
If you truly do not know, I can provide the information here, I'm just trying to protect your privacy wherever I can.
SpideyMod
Community Support Moderator @Experts Exchange
ASKER
I truly don't know, but I would rather you tell me by email rather than posting.
Having said that there may be some backdoor trick that someone else has found...