Export to Excel - Access 2013 to Excel 2013

  • Thread starter Thread starter learning_codes
  • Start date Start date
L

learning_codes

Hi,

I need your help if it works on Access 2007 to Excel 2007 but not Access 2013 to Excel 2012.

Can you tell me if this is not corrected ? I would be appreciated your help.

Here is:


stDocName = "Excel Report"
vFilename = "Excel Report"

If Dir(vFilename) <> "" Then Kill vFilename

If Int(SysCmd(acSysCmdAccessVer)) >= 12 Then ' Access 2007
DoCmd.TransferSpreadsheet acExport, , stDocName, vFilename, True
RetVal = Shell("C:\Program Files\Microsoft Office\Office12\EXCEL.EXE " &
Chr(34) & vFilename & Chr(34) & Chr(34), 1)

Else 'Access 2002

DoCmd.TransferSpreadsheet acExport, , stDocName, vFilename, True
RetVal = Shell("C:\Program Files\Microsoft Office\Office10\excel.exe " &
Chr(34) & vFilename & Chr(34) & Chr(34), 1)
End If

Set qdQ = Nothing
Set dbD = Nothing

Thanks... :)
 
Back
Top