Arthur Fuller
fuller.artful at gmail.com
Sat May 26 20:08:04 CDT 2012
Last week I posted a question about how to do this. In the interim I've worked most of it out. I can create the XLS file, and export the data to it, but can't make the last step work. Once the file has been created and written to, I want Excel to open and open the file too. I've tried various syntaxes, including: <vba> Public Sub RunExcel(strFile As String) Application.Run "C:\Program Files (x86)\Microsoft Office\Office11\Excel.exe " & strFile Application.Run "C:\Program Files (x86)\Microsoft Office\Office11\Excel.exe " & Q(strFile) Application.Run "C:\Program Files (x86)\Microsoft Office\Office11\Excel.exe " & QQ(strFile) End Sub Public Function Q(str As String) Q = Chr(39) & str & Chr(39) End Function Public Function QQ(str As String) QQ = Chr(34) & str & Chr(34) End Function </vba> (Incidentally, I included the two utility functions because they are enormously convenient, so feel free to copy them and use them. They're good for wrapping strings that might contain single or double quotes, for example.) All three calls fail with the message, the only difference being whether the filename is wrapped in quotes or not. Microsoft Access can't find the procedure 'C:\Program Files (x86)\Microsoft Office\Office11\Excel.exe "c:\temp\Customers.xls".' Does anyone know how to accomplish this? TIA, -- Arthur Cell: 647.710.1314 Prediction is difficult, especially of the future. -- Niels Bohr