Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using Office 2003 on Windows XP.
I am trying to convert the following to late binding, but I get an error "...cannot create object..." at the line indicated. I'm sure it is a syntax error, but I don't know what the correct syntax would be. Can someone help me out and post a correction? Dim oFSO As Object Dim oDrives As Object Dim oDrive As Object Dim strLetter As String Set oFSO = CreateObject("Scripting.FileSystemObject") Set oDrives = CreateObject("Scripting.Drives") < ERROR Set oDrive = CreateObject("Scripting.Drive") < ERROR Thanks much in advance for your assistance! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Once you get the reference to the oFSO, then you have access to that object
model: Sub f() Dim oFSO As Object Dim oDrives As Object Dim oDrive As Object Dim strLetter As String Set oFSO = CreateObject("Scripting.FileSystemObject") Set oDrives = oFSO.Drives For Each oDrive In oDrives Debug.Print oDrive.DriveLetter Next End Sub -- Regards, Tom Ogilvy "XP" wrote in message ... I am using Office 2003 on Windows XP. I am trying to convert the following to late binding, but I get an error "...cannot create object..." at the line indicated. I'm sure it is a syntax error, but I don't know what the correct syntax would be. Can someone help me out and post a correction? Dim oFSO As Object Dim oDrives As Object Dim oDrive As Object Dim strLetter As String Set oFSO = CreateObject("Scripting.FileSystemObject") Set oDrives = CreateObject("Scripting.Drives") < ERROR Set oDrive = CreateObject("Scripting.Drive") < ERROR Thanks much in advance for your assistance! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom!
"Tom Ogilvy" wrote: Once you get the reference to the oFSO, then you have access to that object model: Sub f() Dim oFSO As Object Dim oDrives As Object Dim oDrive As Object Dim strLetter As String Set oFSO = CreateObject("Scripting.FileSystemObject") Set oDrives = oFSO.Drives For Each oDrive In oDrives Debug.Print oDrive.DriveLetter Next End Sub -- Regards, Tom Ogilvy "XP" wrote in message ... I am using Office 2003 on Windows XP. I am trying to convert the following to late binding, but I get an error "...cannot create object..." at the line indicated. I'm sure it is a syntax error, but I don't know what the correct syntax would be. Can someone help me out and post a correction? Dim oFSO As Object Dim oDrives As Object Dim oDrive As Object Dim strLetter As String Set oFSO = CreateObject("Scripting.FileSystemObject") Set oDrives = CreateObject("Scripting.Drives") < ERROR Set oDrive = CreateObject("Scripting.Drive") < ERROR Thanks much in advance for your assistance! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Late Binding | Excel Programming | |||
Late Binding examples of binding excel application | Excel Programming | |||
Late Binding | Excel Programming | |||
EARLY binding or LATE binding ? | Excel Programming | |||
DAO Late Binding? | Excel Programming |