refresh excel data with asp script programming - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

refresh excel data with asp script programming

Hi,
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="DRIVER={MICROSOFT EXCEL DRIVER (*.xls)};"
dsnpath=dsnpath & "DBQ=" & Server.mappath ("veritabanı/milan.xls")
Excelsheet.open 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)
RSExcel.movenext
Loop

With this connection, I didn't get the last updated data.in 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

M.R.OZER
[email protected]





Comments

  • mathemathe Posts: 12Member
    hi,

    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:
    ~.begintrans
    ~.committrans

    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.