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

x
?
Solved

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

Posted on 2003-11-09
3
Medium Priority
?
2,161 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
  • 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Do you ever need to create a 20 page Word document for some testing purpose? Are you tired of copying & pasting old boring "lorem ipsum" text over and over again, increasing font size and line space in order to make the document 20+ pages long? Look…
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…
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

824 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