Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


refresh excel data with asp script programming

Sub URL_Get_Query()
With ActiveSheet.QueryTables.Add(Connection:="URL;C:Documents and Settings78687034DesktopVERİNew Page 2.htm " _
, Destination:=Range("a1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

In excel this sub/macro get external data from Url resources.You can do this get external data wizard in Data menus.In asp I made connection with this issued excel file.

set Excelsheet=server.createobject("adodb.connection")
dsnpath=dsnpath & "DBQ=" & Server.mappath ("veritabanı/milan.xls") dsnpath,dbOpenDynaset

Set RSExcel=Server.Createobject("adodb.Recordset")
'Where [Proje Adı]=''
SQLExcel = "Select * from Tablo "
' execute the SQL query
Set RSExcel = Excelsheet.Execute(SQLExcel)
Do while not RSExcel.eof
response.write RSExcel (4)

With this connection, I didn't get the last updated order to do that application I must open the excel file and press again refresh data button or run the macro/sub.How can access the the last updated data using with this hperlink connection Or Is it possible to use database that consisted of extenal html tables. I think I must write a Sub or function and call it in asp pages but I couldn't do it.How could I include this code in my asp pages.Any help will be greatly appreciated.

Best regards

[email protected]


  • mathemathe Member Posts: 12

    i hope i got your problem.

    you change/add something and you dont see these changes
    when you open it the first time?

    i had a problem like this.

    the connection-object has a method you have to use:

    if you use the first before changing data and use the
    last when having data changed, you can use them.
    now if you do a sql-statement after changing data,
    you can see these changes in time.
Sign In or Register to comment.