Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileExist doesn't work
Excel 2000, Windows 2000.
The code below fails at the second line "Object doesn't support method" (Both hu and student are strings with sensible values.) I got the syntax from Excel's Help. I've noticed that fileexist hasn't been turned into FileExist, and though FileExist appears in the help index it isn't found when I press F1... If this method isn't available to me, can you suggest a workaround? Set fs = CreateObject("scripting.filesystemobject") If fs.fileexist(hu & "\students\" & student & ".jpg") Then ' other stuff in here End If |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileExist doesn't work
You can do with without the Scripting library:
Sub test() If Not Dir("C:\T\test.txt") = vbNullString Then Debug.Print "other stuff in here" End If End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "Adrian" wrote in message ... Excel 2000, Windows 2000. The code below fails at the second line "Object doesn't support method" (Both hu and student are strings with sensible values.) I got the syntax from Excel's Help. I've noticed that fileexist hasn't been turned into FileExist, and though FileExist appears in the help index it isn't found when I press F1... If this method isn't available to me, can you suggest a workaround? Set fs = CreateObject("scripting.filesystemobject") If fs.fileexist(hu & "\students\" & student & ".jpg") Then ' other stuff in here End If |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileExist doesn't work
Hi Adrian,
Ad an "s". = fso.FileExists( ) You can also use early binding to avoid syntax problems. Make a reference to the Microsoft Scriptime Runtime library. Dim fso as FileSystemObject Set fso = new FileSystemObject fso.(autocomplete will help you here) ...... Regards Jean-Yves "Adrian" wrote in message ... Excel 2000, Windows 2000. The code below fails at the second line "Object doesn't support method" (Both hu and student are strings with sensible values.) I got the syntax from Excel's Help. I've noticed that fileexist hasn't been turned into FileExist, and though FileExist appears in the help index it isn't found when I press F1... If this method isn't available to me, can you suggest a workaround? Set fs = CreateObject("scripting.filesystemobject") If fs.fileexist(hu & "\students\" & student & ".jpg") Then ' other stuff in here End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to update a column in a work based on another work sheet | New Users to Excel | |||
how can i automatically generate work order numbers from work orde | Excel Discussion (Misc queries) | |||
flash object dont work in my excel work sheet | Excel Discussion (Misc queries) | |||
Counting dates in multiple work sheets and work books | Excel Discussion (Misc queries) | |||
Is there away to keep "auto save" from jumping to the first work sheet in the work book? | New Users to Excel |