Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VBA Stop other macros running when opening linked Excel file

Posted on 2006-06-12
3
Medium Priority
?
334 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
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 1000 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Suggested Courses
Course of the Month12 days, 3 hours left to enroll

916 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