Link to home
Start Free TrialLog in
Avatar of PrimedWebbie
PrimedWebbie

asked on

Runtime Error 4198 In Word Macro When ActiveDocument.SaveAs

Hi,

I am getting the error "Runtime Error 4198" In Word Macro when it hits the following code.

        If ActiveDocument.SaveFormat = 0 Or ActiveDocument.SaveFormat = 12 Then
            ActiveDocument.SaveAs _
            filename:=strDocName(0) & ".pdf", _
            FileFormat:=wdFormatPDF

The problem is very hard to understand as I have the same set of macros running on four different computers, but its falling over on one only.
I have run the msi from microsoft to fix the converting to pdf, but can't see why it falls over on one pc and not the others.

Cheers,
shane.
Avatar of akjain
akjain
Flag of India image

have you tried this link (Error 4198)
Avatar of PrimedWebbie
PrimedWebbie

ASKER

Yeah i saw that but like i said its not happening on three other computers and there are no hyperlinks in the document.
Avatar of GrahamSkan
Have you tried doing the same SaveAs manually? It might give you a more informative message than 'Command failed'.
Are all the machines using the same version of Word? What version is that, by the way?
We are using windows xp and office 2007.  We tried it manually and it worked fine.
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I tried all the steps offered guys. Nothing worked so will have to rebuild machine.  Graham, gives me a chance to give you some more points for helping me out last time. Thanks again.
Suggest people try these as they may help you. I had to rebuild my machine unfortunately.