Solved

VBA Stop other macros running when opening linked Excel file

Posted on 2006-06-12
3
329 Views
Last Modified: 2012-06-21
Hi,

I am having a problem with macros running in an excel file when I open it in the background to update linked data in my word tables.  I am aware that you can turn macros off in Excel by using the Application.EnableEvents = False command but do not know how to fit this in with my current Open Excel File command.  Any Ideas?

Below is the line that I am currently using in the opening of the excel file

Set mobjXLWorkBook = mobjXLApp.Workbooks.Open(FileName:=strPath, UpdateLinks:=False, ReadOnly:=blnReadOnly)
0
Comment
Question by:wobbled
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 250 total points
ID: 16887084
It's a shame that that method isn't availble to the Word Application as well.

However, it would seem logical to try:

mobjXLApp..EnableEvents = False
Set mobjXLWorkBook = mobjXLApp.Workbooks.Open(FileName:=strPath, UpdateLinks:=False, ReadOnly:=blnReadOnly)
0
 
LVL 17

Author Comment

by:wobbled
ID: 16901000
I agree that Word would benifit from such a method.

Did the job fine

Thanks

W
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16901057
Thanks. I've just noticed my error (two dots instead of one). Sorry about that.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When creating Microsoft Word-based forms there may be a need to have a form field repeated throughout the whole document. For instance, with a company name, you may want this information repeated automatically throughout the document rather than man…
Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question