Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a better way .... ?
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00700028
Message ID:
00700753
Views:
17
>>Something like:
>>objExcel.Application.CommandBars.ActiveMenuBar.Controls("Tools").Controls("Macro").Controls("Macros...").Enabled=.f.
>>
>>However I am afraid that even you disable macros, it still can be used from another open document (if any).
>>
>>One of the solution is to remove macro from the document,
>>and do not allow user to replace document when saving.
>>
>>Something like:
>>
>>x=objExcel.Application.VBE.ActiveVBProject.VBComponents
>>x.Remove(x.Item("Module2"))
>
>Thanks - I'll have to do something like that. My problem is that I need to get into a spreadsheet which has all sorts of auto_open macros to get data out of certain sheets (which I only know by checking the name of each sheet).
>
>The macros do things to the data that I don't want.
>
>I may have to run some sort of one-off process that makes a copy of the workbook and strips out the macros.
>
>Is there any other way to get all data out of a workbook (something like IMPORT) which gets the data out and lets you know the name of each sheet ?
>
>Cheers,
>Jamie

Whether /import .... XL8 SHEET sheet_name/ does not do what you need?
Additionally you could use Excel Automation to gather all Sheet Names and then process them as needed. Like:
ObjExcel= CREATEOBJECT("Excel.Application")
with ObjExcel
.Workbooks.Open("c:\book1.xls")
for ia=1 to .Worksheets.count
?.Worksheets(ia).NAme
.....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform