Information générale
Catégorie:
COM/DCOM et OLE Automation
>>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
.....
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement