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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Excel Using MS Access

Status
Not open for further replies.

wandan

Technical User
Dec 16, 2001
101
US
Hi There,

Is there a way to open an existing Excel file from an Access database using either a macro or VBA code?

Basically, I have an Excel file that links directly to an Access table. The MS Query in Excel refreshes on open.

I would like to run my update queries in Access then have it open the Excel sheet for it to refresh then save and close it.

Sounds simple enough, but all I can find it OutputTo which is not exactly what I am looking for.

Thanks.

 
You may try something like this:
Dim myWB As Object
Set myWB = GetObject("\path\to\workbook.xls")
DoEvents
myWB.Save
myWB.Close
Set myWB = Nothing

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top