Hi,
I am trying to run a visual basic macro in excel 2007 that was created in excel 2010.
When working, the macro creates a word document, populates it with data in the spreadsheet then converts to a pdf before emailing.
I'm getting a 438 error at the point where it creates the word document. I believe this is down to the different version of word I am using (having made some changes to the references in excel (to version 12.0).
The debugger has highlighted the following code as the issue:
objword.ActiveDocument.SaveAs2 Filename:=name
& "_" & BookingID & ".docx", FileFormat:= _
wdFormatXMLDocument, LockComments:=False,
Password:="", AddToRecentFiles _
:=True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts _
:=False, SaveNativePictureFormat:=False, SaveFormsData:=False,
_
SaveAsAOCELetter:=False, CompatibilityMode:=14
Running Office 2007 on a Windows 8.1 device. Both 32-bit.
The code works perfectly on Office 2010 on a Windows 7 machine, both 64-bit.
I don't know how to code at all so any advice welcomed.
Thank you.