Your colleagues must be using the Windows operating system.
The FileSystemObject (FSO) is not included with Excel.
Setting the reference in the add you supply should work, almost all the time, except when
it doesn't.
A slightly more sure-footed method is to create the FSO on the fly using "late binding".
Declare all FSO variables as Objects and use CreateObject to grab an instance of the FSO:
'---
Dim fso as Object
Dim fsoFolder as Object
Dim fsoFile as Object
Set fso = CreateObject("Scripting.FileSystemObject")
'---
The above is less efficient than setting a direct reference, but I have never been able to
detect a difference in actual operation.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(List Files: specific files/folders with hyperlinks)
"ManicMiner17" <(E-Mail Removed)>
wrote in message
news:ij88sb$50p$(E-Mail Removed)...
> Hi, I have an addin which I share with some work colleagues.
>
> I recently added a reference to the Microsoft Scripting Runtime to allow me to use the
> FileSystemObject. It opens the old version and imports a phone list into the new blank
> addin.
>
> Before I share the update I would like to figure out whether the new code will work on
> my colleagues machines without having to explicitly add the reference in their VBE? Is
> there a programmatic way to do so? Is it possible to use Application.Run instead of
> adding a reference?
>
> I've read a lot about references but haven't seen anything which deals with this. DB