View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
StuartBisset StuartBisset is offline
external usenet poster
 
Posts: 19
Default Querytables.add with sql query text stored in separate text file



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