Solved

MS Publisher, VBA sample macro from Microsoft creates Automation error

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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Gain an elementary understanding of Blockchain technology.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
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.

724 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