View Single Post
  #5   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

I checked my Excel VBA References and 4 references automatically are included
on all computers I've worked with

Visual Basic for Applications
Microsoft Excel 11.0 Object Library
OLE Automation
Microsoft Office 11.0 Object Library

I've seen problems when these libraries where no pointing to the correct DLL
file. Usually this happens when you upgrade from one verion of Office to
another or from XP to Vista. I also have seen this problem when you use

"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