Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Set object1 = ????

What do I need to put in the ???? to get this code to work?

Dim object1 as object
Set object1 = ????
object1.fileexists()

Thanks!

Bob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Set object1 = ????

I think that you're looking at the FileSystemObject

set a reference to Microsoft Scripting Runtime ... to set a reference to a
dll, in the IDE click references under the Tools menu
Example Code:

Sub TestFileExists()
Dim strFile As String
strFile = Application.GetOpenFilename()
MsgBox FileExists(strFile)
End Sub

Function FileExists(strFilename As String) As Boolean
Dim fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject

FileExists = fso.FileExists(strFilename)

Set fso = Nothing
End Function

HTH
Patrick Molloy
Microsoft Excel MVP

"BobAchgill" wrote:

What do I need to put in the ???? to get this code to work?

Dim object1 as object
Set object1 = ????
object1.fileexists()

Thanks!

Bob



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



All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"