Importing HTML Files

D

DCPan

Another question:

For some strange reason, I get this report that is really in HTML format,
but saved with the extension .xls.

The following VBA Code will work when I resave the file with the correct
extension, but won't work when I leave the file in .xls...WHY?


Sub test1()

Dim strFilePath As String
Dim strFileName As String

strFilePath = "C:\Documents and Settings\DPan1\Desktop\Price"
strFileName = "070807 Moto V3 Magenta w Faves Cst Gr 01 30.xls"

DoCmd.TransferText acImportHTML, "PriceHTML", "test", strFilePath & "\"
& strFileName


End Sub

Sub test2()

Dim strFilePath As String
Dim strFileName As String

strFilePath = "C:\Documents and Settings\DPan1\Desktop\Price"
strFileName = "070807 Moto V3 Magenta w Faves Cst Gr 01 30.htm"

DoCmd.TransferText acImportHTML, "PriceHTML", "test", strFilePath & "\"
& strFileName


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top