Office Word Programming >> Application.Run error message

by UzFsdmVyZmFjZQ » Wed, 19 Nov 2008 03:20:25 GMT

AAarrrrrrrrghhhhhhhh. Can anyone help please.

I have a Macro in Excle VBA which Opens my Word (.doc) file.

I then want it to run the chosen Macro called PrintBPs which is saved within
that word document under the path: Normal > Modules > NewMacros >

I cannot get it to tun the Macro. I have tried many combinations of
Application.run xxxxxxx

When I try Application.run MacroName:="PrintBPs" it tells me Named Argument
not found.

I am so lost. If anyone can help?

------------------------------------------
Below is the code

Sub OpenAWordDoc()
Dim WdApp As Object, WdDoc As Object

Set WdApp = CreateObject("Word.Application")

WdApp.Application.DisplayAlerts = False

WdApp.Documents.Open Filename:="""\\rdc-san04\Method\Briefing Pack -
SB.doc""", _
ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
wdOpenFormatAuto

WdApp.Windows.Application.Activate

WdApp.Visible = True

Application.Run "Normal.NewMacros.Modules.PrintBPs"
End Sub


Office Word Programming >> Application.Run error message

by Doug Glancy » Wed, 19 Nov 2008 14:57:58 GMT


Here's a stripped-down version that works for me:

Sub OpenAWordDoc()
Dim WdApp As Object, WdDoc As Object
Set WdApp = CreateObject("Word.Application")
With WdApp
.Application.DisplayAlerts = False
.Documents.Open Filename:="C:\Documents and Settings\doug\My
Documents\tester.doc"
'.Windows.Application.Activate
.Visible = True
.Run "PrintBPs"
End With
End Sub

I commented out the Windows.Application.Activate line because a) I didn't
know what it was supposed to do b) it didn't compile adn c) it seems to work
without it

Make sure your document path is correct and you should only need one set of
double-quotes.

I used the With WdApp statement in order to avoid referring to it
repeatedly. That will speed up your code.

hth,

Doug








Office Word Programming >> Application.Run error message

by Helmut Weber » Wed, 19 Nov 2008 23:54:01 GMT

Hi S1lverface,

try:

WdApp.run "PrintBPs"

As your code is, if refers to a macro in Excel.

Doug was quite right, by the way.

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP


Application.Run error message

by UzFsdmVyZmFjZQ » Thu, 20 Nov 2008 04:17:01 GMT

Hi Guys.
Thanks very much for your help.

It doesn't work for me. Same error message. - I think it is due to
restrictions on my PC because it is a 'work' computer, and they do restrict
quite a few things. I can work without it. Thanks again.





Application.Run error message

by Helmut Weber » Thu, 20 Nov 2008 20:56:03 GMT

Hi S1lverface,

there might be two causes,
the first is, what I wrote before.

The second might(!) be, according to your office-version,
that as opposed to the online-help,
"application.run" or here "WdApp.run"
doesn't like the full path to a macro.

It might accept only an application-wide unique macro-name.

By the way, a name "Modules" for a module seems rather unusual.
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP


Similar Threads

1. application must be installed to run error message - Microsoft Office

2. OLE objects - Error message - Server Application missing message

When I insert an object (MIcrosoft Excel Worksheet in this case) into Word or 
PowerPoint I can't double click the object to edit it. the message appears 
that the Server Application is missing - Do you want to install it. I go 
through the process of installing it then the same message appears again, or 
else Word locks up completely.

3. Application must be installed to run Error - MS Office Setup

4. 2007 Office SP1 is causing error 2908 when Office Applications run

Microsoft Update recently downloaded and installed 2007 Microsoft Office 
Suite Service Pack 1 (SP1).  After SP1 was installed, whenever I try to open 
any Microsoft Office Suite application an installation process begins for 
that application.  The installation process encounters an error 2908 and the 
installation cannot be completed.  This has left me unable to use any of the 
2007 Microsoft Office Suite applications.
My research into the causes of error 2908 leads me to believe that this is 
related to Microsoft .Net Framework.  I uninstalled the existing version of 
Microsoft .Net Framework (version 1.1) and I also uninstalled Microsoft .Net 
Framework version 1.1 Hotfix.  I downloaded and installed Microsoft .Net 
Framework version 3.0.  This did not eliminate the error.
I uninstalled 2007 Microsoft Office Suite and then reinstalled it using my 
Microsoft software CD ROM.  I am now able to use the Microsoft Office Suite 
applications but I will not be able to apply the 2007 Microsoft Office Suite 
Service Pack 1 (SP1).
What do I need to do to be able to apply the 2007 Microsoft Office Suite 
Service Pack 1 (SP1) without encountering the error 2908?

I am running Windows Vista Ultimate Version 6.0 (Build 6001: Service Pack 1)
-- 
Thank you for your help.

5. the operating system is not presently configured to run this application error - MS Word Support

6. application.filesearch generates run-time error '430'

Word 2003
Windows 2003 Server via Citrix

When I perform the following code on my home Windows 2003 machine all is 
well. When I run it via Citrix (running on a Windows 2003 Server machine), 
it stops on the very first line with a Run-time error '430'

With Application.FileSearch 'this is the line causing the error
    .FileName = "foobar.txt"
    .LookIn = "c:\temp"
    .Execute
    For I = 1 To .FoundFiles.Count
        MsgBox .FoundFiles(I)
    Next I
End With

Full text of error:
Microsoft Visual Basic
Run-time error '430':
Class does not support Automation or does not support expected interface



7. Application Error when running Macro on Workbook open - Word VBA

8. Error message: "This application must be installed to run. Please run setup

Did you get to solve the problem?