Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to suppress Excel macro warning dialogs when using Word's InlineShapes.AddOLEObject

Posted on 2003-11-09
3
Medium Priority
?
2,158 Views
Last Modified: 2007-12-19
Using  Selection.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.8", FileName:= _
        "C:\Documents and Settings\Anne Troy\Desktop\MyVlookup.xls", LinkToFile:= _
        True, DisplayAsIcon:=False
on a spreadsheet containing macros causes Excel to present 3 successive dialog boxes warning about macros. Is there a way to bypass these dialogs?
0
Comment
Question by:ramrom
[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 81

Expert Comment

by:byundt
ID: 9710810
Hi ramrom,
Try the following:
Application.DisplayAlerts=False
'Your code
Application.DisplayAlerts=True

Cheers!

Brad
0
 
LVL 17

Author Comment

by:ramrom
ID: 9710827
That does not do it. It is Excel, as I said, that displays the warning, not Word, and I'm automating Word.
0
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 9710848
ramrom,

Dim xlApp as Object
Set xlApp=CreateObject("Excel.Application")
xlApp.DisplayAlerts=False
'Your code
xlApp.DisplayAlerts=True

Brad
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
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 …

688 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