View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Querytables.add with sql query text stored in separate text fi

You don't need a reference library. You only need libraries if you are using
other office products functions. For example ADO objects are a Microsoft
Access library functions. Excel has the File I/O functions built into the
excel library.

"StuartBisset" wrote:



Hi Joel

Thanks for your prompt reply. Do I need to tick a reference library
(Tools References in the VBE) to use the code I've quoted below as
OpenTextFile, ReadFile, ForReading and TristateTrue are not recognised
methods/properties in my VBE?

Set fs = CreateObject("Scripting.FileSystemObject")
Set fin = fs.OpenTextFile(ReadFile, _
ForReading, TristateTrue)


Kind regards

Stuart