Runtime Error 4198 In Word Macro When ActiveDocument.SaveAs

PrimedWebbie
PrimedWebbie used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
have you tried this link (Error 4198)

Author

Commented:
Yeah i saw that but like i said its not happening on three other computers and there are no hyperlinks in the document.
GrahamSkanRetired
Top Expert 2012

Commented:
Have you tried doing the same SaveAs manually? It might give you a more informative message than 'Command failed'.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Are all the machines using the same version of Word? What version is that, by the way?

Author

Commented:
We are using windows xp and office 2007.  We tried it manually and it worked fine.
Retired
Top Expert 2012
Commented:
It might be worth trying the steps in this article

http://support.microsoft.com/default.aspx/kb/921541

Author

Commented:
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.

Author

Commented:
Suggest people try these as they may help you. I had to rebuild my machine unfortunately.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial