Milos Cuculovic
Milos Cuculovic

Reputation: 20223

How to apply SaveAs on Word for Mac?

I have this VBA code in a Word for Mac 2016

ActiveDocument.SaveAs FileName:= _
     "forMerrin.htm", FileFormat:= _
     wdFormatFilteredHTML, LockComments:=False, Password:="", AddToRecentFiles _
     :=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _
     :=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
     SaveAsAOCELetter:=False

It returns:

Run-time error: "5460"
A file error has occurred.
(forMErrin.htm)

I tried SaveAs2 but still the same problem.

Upvotes: 0

Views: 157

Answers (1)

Timothy Rylatt
Timothy Rylatt

Reputation: 7850

The filename needs to include the path - "forMerrin.htm" only tells Word what you want to name the file but not where you want to put it.

Upvotes: 1

Related Questions