Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Call Excel from VB6 disabling macros
I can call a workbook from within VB6 get infromation and close the workbook after I have what I need, but my problem is that a macro is setup to call a user form at the opening of this particular excel file, without editing the excel file, can I open it from within vb and disable the macro(s)
-- Message posted via http://www.officekb.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Call Excel from VB6 disabling macros
Yes. Security is at application level, so when you instantiate Excel, set
tsecurity to Medium or High. When the workbook opens, the appl will raise a messager unless you set DisplayAllerts = False. This will allow the workbook to open without allowing any code to run. Its designed to prevent malicious software getting in through Office applications. Patrick Molloy Microsoft Excel MVP "Derek Hardison via OfficeKB.com" wrote: I can call a workbook from within VB6 get infromation and close the workbook after I have what I need, but my problem is that a macro is setup to call a user form at the opening of this particular excel file, without editing the excel file, can I open it from within vb and disable the macro(s) -- Message posted via http://www.officekb.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Call Excel from VB6 disabling macros
First, Thank You, but I understand that and I use the excel workbook I created to keep records, therfore I like the code to run when I open it myself, but when I just want to get select info from the workbook and use it in another application created with VB6, I do not want the excel code to run. You may have answered this but I haven't had any luck with it. Maybe some sample VB6 code would help me?
Thanks again, Derek -- Message posted via http://www.officekb.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Call Excel from VB6 disabling macros
Hi Derek,
In your VB6 code, switch off Excel's events before opening the workbook. eg. objXL.EnableEvents = False objXL.Workbooks.Open ... Regards, Vic Eldridge "Derek Hardison via OfficeKB.com" wrote: First, Thank You, but I understand that and I use the excel workbook I created to keep records, therfore I like the code to run when I open it myself, but when I just want to get select info from the workbook and use it in another application created with VB6, I do not want the excel code to run. You may have answered this but I haven't had any luck with it. Maybe some sample VB6 code would help me? Thanks again, Derek -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disabling macros | Excel Discussion (Misc queries) | |||
Can I call my .Net functions from Excel Macros | Excel Programming | |||
Disabling Macros | Excel Programming | |||
Disabling/Enabling Macros | Excel Programming | |||
preventing disabling of macros | Excel Programming |