Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you give the code to someone to run, why would they need context help?
Most recommend developing with the reference, then convert to late binding for distibution. -- Regards, Tom Ogilvy "Tony Seiscons" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Microsoft Outlook Library | Excel Discussion (Misc queries) | |||
VB Scripting/Macro - Filling/Editing Worksheet References | New Users to Excel | |||
Library references | Excel Programming | |||
Object Library References | Excel Programming | |||
Object Library References | Excel Programming |