Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import Spreadsheet from web

Status
Not open for further replies.

ghloid

IS-IT--Management
Mar 11, 2002
85
US
Here's a real doozy for ya everyone,

I'm trying to import a spreadsheet from a web site using just the minimal amount of code possible (don't want to write a whole big module here or anything--unless I have to of course). I have looked at some other methods of doing this. One method involved using the Microsoft Internet Transfer ActiveX Control, but I apparently don't have that control on my computer, and I'm not sure it's the right method I would want to use anyway (I don't have an FTP server, so that may not work).

At any rate, I am NOW looking at the REAL simple transferspreadsheet command. This seems to ALMOST work. I have the following line of simple code:

Private Sub cmdTest_Click()
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "TempImport_Tbl", " True
End Sub

One line of code MIGHT do it. However, when I try to run this routine, I get an "error 3651, not a valid Internet Address" That's weird, because the address is perfectly valid (try it in a simple browser window and you'll see). Seems like this little code line MIGHT just work if I'm getting an error that actually recognizes that as an Internet address.

I need to import data into this simple database directly from a web site (I'm sure this can be done). I want it to be imported into a temp table I have in the database, and then I want to do some queries and other things to format the data (I've got that down fine).

If anyone knows of a way to do this, I'd sure appreciate the help.

As always, this forum is the best, so thanks in advance for any help anyone can offer!
 
Hey Pete,

Thanks for the quick reply (I LOVE this forum). That seems to be what I'm looking for. I won't have time to check it till later tomorrow though probably. Still, there's some code there that looks like it would do the trick (the Sub TestHTTP() stuff).

I'll give it a shot, and hopefully get something to work there.

Thanks again!
Brian
 
Well, I've been playing with BOTH of the routines now with not much in terms of results (the msxml.dll approach just doesn't really seem to grab any file that I can see). I like the Wininet idea, and I've started researching that a bit more with this page:


but, I'm still pretty lost. Apparently, you don't simply include this in your references library, you have to call it through code.

So, both of these methods may have some promise, but they're pretty complex to me.

Is there no other more simpler way to do this? I wish that Transferspreadsheet command would work (and it seemed to have promise), but I get no where with that either.

If anyone else has some ideas, or perhaps could shed some insight on how exactly to configure the wininet method (or even the msxml.dll method) as described in Pete's post, I'd greatly appreciate it.

All this code is making me dizzy.

%-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top