Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling macros EllenM Excel Discussion (Misc queries) 1 February 26th 08 04:57 PM
Can I call my .Net functions from Excel Macros Yuhong Excel Programming 1 December 3rd 04 07:29 PM
Disabling Macros R. SRIKANTH Excel Programming 4 January 11th 04 03:26 PM
Disabling/Enabling Macros HRobertson Excel Programming 2 October 24th 03 04:07 PM
preventing disabling of macros Combo[_2_] Excel Programming 0 October 9th 03 12:46 AM


All times are GMT +1. The time now is 04:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"