Export to Excel - Access 2013 to Excel 2013


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... :)
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top