Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runcommand for Analyse with Excel

Status
Not open for further replies.

startacc

IS-IT--Management
Jan 21, 2002
16
IE
Hello all!
In the pre '97 version of Access you could use DoMenuItem to open Excel (Office Links, Analyse with Excel) so what happened to this command with Runcommand. OutputtoExcel still exists but does not open Excel. Any ideas how to open Excel from Access with a report open?

Thanks
Claire
 
Hi, have you tried the Shell command in Access VB? There may be a more appropiate way as I am not that familiair with Access, but this does open a particular excel spreadsheet. Regards Gary
 
This code will transfer a table / query into a folder then open the file in Excel (either an open session or opening Excel)

Dim mno As String, TemplateFile As String
Dim XLApp As Object
TemplateFile = "C:\My Documents\AccessData.XLS"
On Error Resume Next 'ignore error if Excel not running
Set XLApp = GetObject("Excel.Application")
If Err <> 0 Then
Set XLApp = CreateObject(&quot;Excel.Application&quot;)
End If
On Error GoTo 0
XLApp.Visible = True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, &quot;OneBillSummary&quot;, TemplateFile, True
XLApp.workbooks.Open TemplateFile
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top