Hi all,
Happy Friday!
Wonder if someone could take a look at this code for me and tell me whats wrong with it. Ive looked at a few examples online but I think it should be working. When I try to open the exported file, it tells me taht the format doesnt match the file extension. Im using 2007. Does this look right?
Thanks
Happy Friday!
Wonder if someone could take a look at this code for me and tell me whats wrong with it. Ive looked at a few examples online but I think it should be working. When I try to open the exported file, it tells me taht the format doesnt match the file extension. Im using 2007. Does this look right?
Thanks
Code:
[COLOR=#1f497d][FONT=Arial]FileName = "MyFileName (" & Format([Today], "MMYYYY") & ").xlsx"[/FONT][/COLOR]
[COLOR=#1f497d][FONT=Arial]Path = "C: \"[/FONT][/COLOR]
[COLOR=#1f497d][FONT=Arial]VarSQL = "MyTbl"[/FONT][/COLOR]
[COLOR=#1f497d][FONT=Arial]DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, VarSQL, Path & FileName[/FONT][/COLOR]