Opening an Excel Spreadsheet from MS Access

G

Guest

I am trying to open an existing Excel Sheet from within an Access db. My
users insist on having Excel spreadsheets as opposed to Access reports so I
take a table and dump it into Excel using transferspreadsheet.

What I am trying to do now is after the user clicks a button in the Access
app, I want to display the spreadsheet I've just updated.

Here is the code as it stands now:

Dim oSheet As Object
Set oSheet = GetObject("C:\Documents and Settings\E09461\My Documents\Access
Db's\Development\MetricsDashboardReport.xlt")
Dim oApp As Object
Set oApp = oSheet.Parent
oApp.Visible = True
oApp.UserControl = True

This works after a fashion but... when I toggle to Excel, my workbook is
open but hidden, is there anything I can do to rectify this or am I on the
wrong path altogether?

Thanks,

m
 
F

fredg

I am trying to open an existing Excel Sheet from within an Access db. My
users insist on having Excel spreadsheets as opposed to Access reports so I
take a table and dump it into Excel using transferspreadsheet.

What I am trying to do now is after the user clicks a button in the Access
app, I want to display the spreadsheet I've just updated.

Here is the code as it stands now:

Dim oSheet As Object
Set oSheet = GetObject("C:\Documents and Settings\E09461\My Documents\Access
Db's\Development\MetricsDashboardReport.xlt")
Dim oApp As Object
Set oApp = oSheet.Parent
oApp.Visible = True
oApp.UserControl = True

This works after a fashion but... when I toggle to Excel, my workbook is
open but hidden, is there anything I can do to rectify this or am I on the
wrong path altogether?

Thanks,

m

Try it this way:

DoCmd.TransferSpreadsheet etc....
Application.FollowHyperlink ""C:\Documents and Settings\E09461\My
Documents\Access Db's\Development\MetricsDashboardReport.xlt")

Note: you have the Excel workbook extension as xlt not xlc, Is that
that you want?
 
G

Guest

Yes, the output is actually an Excel template that formats the data the way
the user wants it.
 

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

Top