FileSystemObject Not Behaving

Benjamin1986

Board Regular
Joined
May 18, 2007
Messages
60
Everyone,

I am attempting to use VBA to open an ASP file from my company's intranet, and I'm running into a problem.
Code:
dim FileSys as Object, DataFile as Object
Dim FileName as string
dim ReadLine as string

set FileSys = CreateObject("Scripting.FileSystemObject")

Filename = "http://intranet/ViewThisItem.asp?ID=12345"

set Datafile = FileSys.opentextfile(FileName)
The problem is that the last line quoted is failing. It's just giving an "Error 52 Bad File Name or Number" message. The file opens properly in Notepad, so I know that the file name is correct. This is problematic since there's no other way for me to get this data.

Ideas?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,224,566
Messages
6,179,558
Members
452,928
Latest member
101blockchains

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top