Discussion:
Linking to excel spreadsheet over the Internet
(too old to reply)
Matthew Freeze
2004-09-16 16:26:07 UTC
Permalink
My problem is this, I need to find a way to link to a excel spreadsheet on a
customers website so that whenever my program opens it automatically alerts
me whether or not a change has occurred and if so allows me to download the
new spreadsheet right into my database. I've read alot on linking but where
should I begin. Has anyone else ever had to do this, and if so, how did you
accomplish it. Thanks for all your help guys.--Matt
Sietse Wijnker
2004-09-17 22:09:51 UTC
Permalink
Hi Matthew,

To download a file from the internet you can use the following:
DECLARE INTEGER URLDownloadToFile ;
IN urlmon.dll ;
INTEGER pCaller, ;
STRING szURL, ;
STRING szFileName,;
INTEGER dwReserved, ;
INTEGER lpfnCB

= URLDownloadToFile (0, lcURL, lcLocalFile, 0, 0)
The problem here is that there's no way of knowing the file size and date
before downloading it. To retrieve that kind of information you can place an
XML file next to it specifying the file size and date, and retrieve the XML
file in the same way, or you can use the XMLHTTP object like this:

objHTTP = CreateObject("MSXML2.XMLHTTP")
objHTTP.Open("GET", url,.f.)
objHTTP.Send()

After a successfull dwnload the objHTTP.responsexml cotains the XML that is
retrieved in a DOM

Maybe there's a better way for etrieving file info before you download, but
i'm still searching for it

Regards,
Sietse Wijnker
Matthew Freeze
2004-09-21 20:49:01 UTC
Permalink
Mr.Wijnker:
Thank you very much, Iwill give it a try and let you know if it works, or
what I did to solve this problem. --Matt
Post by Sietse Wijnker
Hi Matthew,
DECLARE INTEGER URLDownloadToFile ;
IN urlmon.dll ;
INTEGER pCaller, ;
STRING szURL, ;
STRING szFileName,;
INTEGER dwReserved, ;
INTEGER lpfnCB
= URLDownloadToFile (0, lcURL, lcLocalFile, 0, 0)
The problem here is that there's no way of knowing the file size and date
before downloading it. To retrieve that kind of information you can place an
XML file next to it specifying the file size and date, and retrieve the XML
objHTTP = CreateObject("MSXML2.XMLHTTP")
objHTTP.Open("GET", url,.f.)
objHTTP.Send()
After a successfull dwnload the objHTTP.responsexml cotains the XML that is
retrieved in a DOM
Maybe there's a better way for etrieving file info before you download, but
i'm still searching for it
Regards,
Sietse Wijnker
Loading...