Solved

VBA Stop other macros running when opening linked Excel file

Posted on 2006-06-12
3
330 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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.

623 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