I'm not too sure if Scripting.FileSystemObject can cross machine
boundries...
But, I ran a quick test to just pass it around:
Private Sub Command1_Click()
Dim FS As New FileSystemObject
Form2.GetDrives FS
End Sub
Public Sub GetDrives(ByRef FS As Scripting.FileSystemObject)
Dim thing As Variant
Label1 = ""
Me.Show
For Each thing In FS.Drives
Label1 = Label1 & " " & thing.DriveLetter
Next
End Sub
This worked fine... You may need to use an UNC to connect to your remote
drives.
Private Sub Command2_Click()
Dim FS As New FileSystemObject
FS.CopyFile "\\remotecomputer\share\file.txt",
"\\localcomputer\path\file.txt"
End Sub
This works fine... 'course, I don't know what you are really trying to
accomplish, but I hope this helps.
-Kris
Quote:
>Actually I tried both Len and LenB and I get the same error ('object does
>not support this property'). I agree that it is a bit scary copying the
>values through memory, but I'm not sure how else to do it. What I need to
>do is move the FileSystemObject variable from one machine to another (sort
>of like how you would transfer a file). I know who to move the value of a
>long or integer, but I know how many bytes they take up so I can use it in
>my memcopy (or equivalent).
>Essentially I'm trying to get the FileSystemObject to a remote computer
that
>is not located on a network. How can I transfer the value of a variable
>from one machine to another (without using ActiveX automation)?
>Thanks,
>Tim