For many years I have automated office applications from Visual Basic through the Office Object Model. This has been working fine for all versions from 2003 but failed when I upgraded to Office 2013.
With Word 2013 the SaveAs2 method seems to ignore the parameters and instead always pops up the File SaveAs dialog. Irrespective of save or cancel the method then always returns the error 4198.
The SaveAs2 method works fine in Word 2010 as well as SaveAs in earlier versions. According to the documentation for 2013 it should work the same way for the new version, but so far I’m stuck with this problem.
I’m using Microsoft Office Home and Business 2013 on a Windows 8 system. I’ve also tried the SaveAs2 directly in Microsoft Word VBA. The macro below gives exactly the same sad result.
Public Sub MySave()
Dim MyName As String
MyName = "TestDocument.doc"
ActiveDocument.SaveAs FileName:=MyName, FileFormat:=wdFormatDocument
End Sub
I seem to be completely stuck. Does anyone know what the trick is here?