Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting VBA scripts from Excel worksheets
Message
From
22/06/2016 14:46:31
 
 
To
22/06/2016 12:03:54
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01637533
Message ID:
01637589
Views:
43
>>>Hi All:
>>>
>>>We have inherited the support of a couple of dozen Excel spreadsheets. These all have a bunch of VBA methods.
>>>
>>>Is there some way we can open the spreadhseets and extract the method code so that we can build a big code database that can be searched
>>>
>>>For example ..... Which methods in which spreadsheets reference a particular drive mapping???
>>> Which methods in which spreadsheets use a specific DSN
>>> etc.
>>>
>>>How can we accumulate the VBA code to do those kinds of searches?
>>>
>>
>>I was sure I'd written something about this, but I can't find it. Regardless, check out the Modules collection in VBA.
>>
>>Tamar
>Thanks for the advice. If you have any pointers or links on how to use this it would help a great deal. So far I've tried
>oXl = CREATEOBJECT('excel.application')
>oWb = oXl.wookbooks.open(GETFILE())
>? oXl.modules.count --> 0
>? oXl.application.modules.count --> 0
>? oWb.modules.count --> 0
>? oWb.application.modules.count --> 0
>
>
>Google hasn't been especially useful for me either.
>

As I said, I remember playing with this at least once, but apparently, I didn't write about it. I have a vague memory that you need to work through the Excel IDE objects, not the workbook.

I just poked a little at the Excel Object Model, but I just can't remember how I got to what I needed or what I did this for (so I could go look at some code).

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform