Solved

MS Publisher, VBA sample macro from Microsoft creates Automation error

Posted on 2008-10-02
1
1,834 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Let’s list some of the technologies that enable smooth teleworking. 
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

856 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