Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel VBA on my work PC throws errors when I try to refer to the class
'FileSystemObject' or its associated constants (such as 'WindowsFolder'). Which library is the one I need a reference to? Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming scripting is not disabled, you need add a reference
(ToolsReferences) to "Microsoft Scripting Runtime". NickHK "Allen_N" wrote in message ... Excel VBA on my work PC throws errors when I try to refer to the class 'FileSystemObject' or its associated constants (such as 'WindowsFolder'). Which library is the one I need a reference to? Thanks! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just to add, without the reference you could use late binding but subject to
scripting not disabled as Nick mentioned. You would need to declare all related object variables "As Object" and use numeric values instead of named constants and would loose intellisence, eg Sub test() Dim oFSO As Object On Error GoTo errH Set oFSO = CreateObject("Scripting.FileSystemObject") For i = 0 To 2 Debug.Print oFSO.GetSpecialFolder(i) Next Exit Sub errH: MsgBox Err.Description End Sub Regards, Peter T "NickHK" wrote in message ... Assuming scripting is not disabled, you need add a reference (ToolsReferences) to "Microsoft Scripting Runtime". NickHK "Allen_N" wrote in message ... Excel VBA on my work PC throws errors when I try to refer to the class 'FileSystemObject' or its associated constants (such as 'WindowsFolder'). Which library is the one I need a reference to? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FileSystemObject help please. | Excel Programming | |||
FileSystemObject help please. | Excel Programming | |||
Filesystemobject Help | Excel Programming | |||
filesystemobject | Excel Programming | |||
Help with FileSystemObject? | Excel Programming |