Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am having a macro search for a file on the desktop under "C:\Documents and
Settings\All Users\Desktop\" using "result = Object.FileExists(file_name)". I know the file exists, but the result is always false. Is there something wrong with FileExists, or should I do something different? Thanks, Matthew |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Good morning Pflugs This code will return true or false (displayed in a msgbox) when checking for a file. Sub DoesFileExist() Set MyFile = CreateObject("Scripting.FileSystemObject") MsgBox MyFile.FileExists("c:\book1.xls") End Sub HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=401651 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You say you know it exists ... I assume because you see it on your
desktop... Are you sure it is in All Users\Desktop and not rather in your own UserName\Desktop? They are not the same path, even though files in either will show on (your) desktop. Bill "Pflugs" wrote in message ... I am having a macro search for a file on the desktop under "C:\Documents and Settings\All Users\Desktop\" using "result = Object.FileExists(file_name)". I know the file exists, but the result is always false. Is there something wrong with FileExists, or should I do something different? Thanks, Matthew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
File Exists Formula | Excel Worksheet Functions | |||
File Exists | Excel Discussion (Misc queries) | |||
IF File Exists | Excel Programming | |||
File already exists | Excel Programming | |||
the file already exists - do you want to replace the existing file? | Excel Programming |