Import data from xls file on the web

  • Thread starter Svilen Pachedzhiev
  • Start date
R

Ron de Bruin

Good morning Topola

I don't think it is working for xml files but with xls it is no problem

You can copy it to your computer and use that file maybe ?
It change the sheetname to Sheet1 (easy for the Vlookup formula)

Dim wb As Workbook
Set wb = Workbooks.Open("http://www.nbp.pl/Kursy/xml/a236z051207.xml")
wb.Sheets(1).Name = "Sheet1"
wb.SaveAs "C:\Kursy.xls", FileFormat:=xlNormal
wb.Close False

If you they only change the date (051207) in the filename you can make it automatic open/save the file
from the day you run the macro with code.
 
T

topola

Ron,
thank you again, it helped me much.

Everything works fine except from replacing a C:\kursy.xls file.
How to avoid replacing alert?

I tried
wb.Saved
but with no result.

Topola
 
R

Ron de Bruin

Application.DisplayAlerts = False

wb.SaveAs "C:\Kursy.xls", FileFormat:=xlNormal

Application.DisplayAlerts = True
 
Top