Help Saving Word Document From Excel - Compiler Error "Named Argument Not Found"

JimHol

Active Member
Joined
Jan 4, 2011
Messages
314
I copied the code below from a source I found online which is purported to work but for me I get a Compiler Error "Named Argument Not Found" on "FileFormat" I am using Office 2007 and the Word document I am attempting to save is open.

Code:
ActiveDocument.SaveAs Filename:="test.docx", FileFormat:=wdFormatXMLDocument _
 , LockComments:=False, Password:="", AddToRecentFiles:=True, _
  WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
  SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False

Thanks,
Jim
 
Last edited:

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
That didnt work I got a "Method or Data Member Not Found" Error while compiling. Not sure if it matters but the VBA macro is part of an Excel document.
 
Upvote 0
Which version of Word are you using?

Does this work?
Code:
ActiveDocument.SaveAs FileName:="test.docx", FileFormat:=wdFormatXMLDocument
 
Upvote 0
What I had was an Excel macro that searched PowerPoint presentations for embedded Word documents, open them then save them out as separate files. Below is the code I finally come up with for saving the Word documents. Works Great!

Code:
relativePath = PresPath & oPPTPres.Name & "(" & ThisSlide & ")(" & ThisEmbdName & ").docx"
Set oSaveWdDoc = Shape.OLEFormat.Object
oSaveWdDoc.SaveAs Filename:=relativePath, FileFormat:=wdFormatDocumentDefault

Thanks for the assist,
Jim
 
Upvote 0

Forum statistics

Threads
1,225,681
Messages
6,186,411
Members
453,352
Latest member
OrionF

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top