Solved

MS Publisher, VBA sample macro from Microsoft creates Automation error

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

730 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