LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default References and Microsoft Scripting Runtime library

I know that I can create two file scripting objects with

Dim fsObject As Object, tsTextFile As Object

and then assign them with :

Set fsObject = CreateObject("Scripting.FileSystemObject")
Set tsTextFile = fsObject.OpenTextFile("C:\FolderName\TextFileName. txt",
1)

without setting a reference to the Microsoft Scripting Runtime Library.

If I create a reference to the library with Tools-References in the VB IDE I
can use

Dim fsObject as Scripting.FileSystemObject
Dim tsTextFile as Scripting.TextStream

and then

Set fsObject =New FileSystemObject
Set tsTextFile New tsOpenText("C:\FolderName\TextFileName.txt",
ForWriting, True)

I guess that this is early and late binding.

My question is this. I know that the first set of code will run without the
reference to the Microsoft Scripting Runtime Library set via the IDE but
will the second method? The second one is more useful to work with as the
context help becomes available with the reference set but if I give the
program to someone else I don't think it will it still work without the
reference being set. Can I set the reverence in code?

Tony


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Outlook Library splodgey Excel Discussion (Misc queries) 2 August 9th 07 03:58 PM
VB Scripting/Macro - Filling/Editing Worksheet References Meghan New Users to Excel 2 December 16th 04 05:55 PM
Library references Amanda[_5_] Excel Programming 1 January 6th 04 06:40 PM
Object Library References Nelson[_5_] Excel Programming 5 December 10th 03 08:54 PM
Object Library References Nelson[_6_] Excel Programming 1 December 10th 03 03:31 AM


All times are GMT +1. The time now is 11:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"