PDA

View Full Version : Open excel and refreshall



chungtinhlak
04-02-2009, 07:01 AM
Hi all, I am really new with Access VBA. I use Excel to chart a bunch of stuff and in the Excel file, it's link directly to my Access Database. So when I update the database, from there, I want to open that excel file and refreshall. Can someone help me with this.

I try this but it does not work.


Sub RefreshChart()
Dim xls As Object
Set xls = GetObject("C:\Switchboard\T2\daily\Aging EPD's\Daily Backlog Metric.xls")
xls.Application.Visible = True
xls.Application.Refreshall
xls.application.close savechanges:=Yes


End Sub

CreganTur
04-02-2009, 07:54 AM
I try this but it does not work.

Is it giving you an error message, or just not doing what you expect?

chungtinhlak
04-02-2009, 08:24 AM
it gives me an error saying object not supportive at the refreshall line, but the excel file not open.