Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Help converting code to late binding

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help converting code to late binding

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   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Help converting code to late binding

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
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
Late Binding Mark Excel Programming 4 October 17th 05 04:02 PM
Late Binding examples of binding excel application HeatherO Excel Programming 13 March 17th 05 08:19 AM
Late Binding Todd Huttenstine[_3_] Excel Programming 3 April 30th 04 11:01 AM
EARLY binding or LATE binding ? jason Excel Programming 6 February 26th 04 04:57 PM
DAO Late Binding? Sharqua Excel Programming 2 January 4th 04 02:05 AM


All times are GMT +1. The time now is 03:13 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"