Refresh Excel Table from Access (1 Viewer)

dlugirapfr

Registered User.
Local time
Today, 03:14
Joined
Nov 22, 2012
Messages
68
Hi,

I tried to find topic with solution for my problem but I cannot.
I have Office 365 (32 bit)
I have to download Excel file from www. with direct link. So I have to do it in Excel (Acccess can only import XML file from www :( ).
I made Excel (sample.xlsx) file with connection to table on Internet and it works - I can refresh it etc.

I connected sample.xlsx to Access database.

How can I refresh data in sample.xlsx from Access?
Thank you for replay and links.
 

NauticalGent

Ignore List Poster Boy
Local time
Yesterday, 21:14
Joined
Apr 27, 2015
Messages
6,328
Couple ways to do this. Right-clicking on the linked table and selecting "Refresh Link" will do it. If you want to do it with code, here is a sub I copied from a VBA Forum a few years ago:
Code:
sub RefreshMyExcelTableLink()
    Dim tdf As DAO.TableDef

    Set tdf = Currentdb.TableDefs("TheNameOfYourExcelSheet")
    tdf.RefreshLink
    Set tdf = Nothing
end sub
 

dlugirapfr

Registered User.
Local time
Today, 03:14
Joined
Nov 22, 2012
Messages
68
Thank you for replay but I think in that way you refresh only link between access and excel.
I need to refresh data between Excel and Internet ;)
 

June7

AWF VIP
Local time
Yesterday, 17:14
Joined
Mar 9, 2014
Messages
5,470
Perhaps need Excel automation code that executes refresh of web link.

For a start, turn on macro recorder in Excel, perform refresh procedure. Adapt macro generated code in Access VBA.
 

NauticalGent

Ignore List Poster Boy
Local time
Yesterday, 21:14
Joined
Apr 27, 2015
Messages
6,328
Apologies, I misunderstood your question.
Hopefully some one smarter than me will see this post and reply!
 

Users who are viewing this thread

Top Bottom