Solved

MS Publisher, VBA sample macro from Microsoft creates Automation error

Posted on 2008-10-02
1
1,800 Views
Last Modified: 2013-12-17
In a MS Publisher VBA module, I am trying to open an other Publisher instance. I found the attached sample code on the microsoft website. Unfortunately it does not work on my computer. Any ideas what I need to do to make it work?
Sub ModifyAnotherPublication()

    ' Create new instance of Publisher.

    Dim appPub As New Publisher.Application

 

    ' Open publication.

    appPub.Open Filename:="C:\Publication1.pub"

 

    ' Put code here to modify the publication as necessary.

 

    ' Close the publication.

    appPub.ActiveDocument.Close

 

    ' Release the other instance of Publisher.

    Set appPub = Nothing

End Sub

Open in new window

0
Comment
Question by:VB-tinkerer
1 Comment
 

Accepted Solution

by:
VB-tinkerer earned 0 total points
ID: 22638010
I have not received a solution to this question.

However I managed to find a different way to create an other instance of MS Publisher. (see code below) So no further input is required.
Set pubApp = CreateObject("Publisher.Application")

With pubApp

   ....

   ....

End With

Open in new window

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
A list of useful business intelligence software.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now