Link to Excel Spreadsheet from Access form

G

Guest

My access db relies on information that first must be reformatted using
Excel. On my Add New Record form, I want to link to this Excel spreadsheet
using a command button. How do I specifiy the specific spreadsheet to be
called up? I'm assuming I'll use an On Click procedure, but need help
writing the Visual basic code. Thanks
 
G

Guest

Thank you for your quick respons, but.... it doens't work.
Find here some code I used; maybe there is some mismatch in the used syntax:

Dim oSource As Object
Dim StrSource As String
Set oSource = CreateObject("Excel.Application")


'Not Allocated.xls
StrSource = "I:\be\_agb\agfaproj\logistiek\WOS\Not Allocated.xls"
oSource.Workbooks.Open (StrSource)
'oSource.Visible = True
oSource.Run ("RefreshAll")

'this doens't work
objActiveWkb.Close Savechanges:=True
'this doens't work
oSource.Close Savechanges:=True

oSource.Workbooks.Close (StrSource)
 

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