|
Как отключить макросы в Excel - нужно для загрузки данных из файла excel |
☑ |
0
TigerPXN
07.08.06
✎
20:13
|
Есть проблема: в файле Excel есть макрос, который при открытии изменяет данные (информацию о пользователе). Когда в него вносят данные пользователи - это нужно. Мне нужно считать информацию из файла в 1С, а она при открытии файла в 1С сама изменяется ((. Как бы отключить макросы, исполняемые при открытии файла?
|
|
1
абсд
07.08.06
✎
20:48
|
В Excel2003 макросы отключаются: Сервис->Макрос->Безопастность выбераешь нужный режим
|
|
2
ШтушаКутуша
07.08.06
✎
20:53
|
а еще,есть переменная xlAuotoOpen,задействовать:
WBook.RunAutoMacros(xlAutoOpen);
....так я подумал,может есть константа xlNonAutoOpen?
|
|
4
Kraft
08.08.06
✎
06:18
|
(2) сильно,... внушает
|
|
5
skunk
08.08.06
✎
06:22
|
RunAutoMacros Method
Runs the Auto_Open, Auto_Close, Auto_Activate, or Auto_Deactivate macro attached to the workbook. This method is included for backward compatibility. For new Visual Basic code, you should use the Open, Close, Activate and Deactivate events instead of these macros.
Syntax
expression.RunAutoMacros(Which)
expression Required. An expression that returns a Workbook object.
Which Required. The macros to run. Can be one of the following XlRunAutoMacro constants:
Constant Description
xlAutoOpen Auto_Open macros
xlAutoClose Auto_Close macros
xlAutoActivate Auto_Activate macros
xlAutoDeactivate Auto_Deactivate macros
|
|
6
skunk
08.08.06
✎
06:23
|
|
|
7
smaharbA
08.08.06
✎
10:49
|
тупой метод set wshshell=createobject("wscript.shell") call wshshell.run("excel.exe /safe c:\книга1.xls",,0) wscript.sleep 2000 wshshell.sendkeys("~") wscript.sleep 1000 set excel=getobject(,"excel.application") excel.visible=0 msgbox excel.workbooks.count excel.visible=-1
|
|