Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I try to save the file. I'd like to prevent the case when the path i
wrong - Temp directory doesn't exist - and show the warning by myself ex. ThisWorkbook.SaveAs C:\Temp\1.xl -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "ira " wrote in message ... I try to save the file. I'd like to prevent the case when the path is wrong - Temp directory doesn't exist - and show the warning by myself. ex. ThisWorkbook.SaveAs C:\Temp\1.xls --- Message posted from http://www.ExcelForum.com/ You can use to the filesystem object and the folderexists method Set fs = CreateObject("Scripting.FileSystemObject") If fs.FolderExists("C:\Temp") Then MsgBox "OK" Else MsgBox "not found" End If Set fs = Nothing Keith |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ira,
Use the DIR function Dir("C:\Temp", vbDirectory) it returns blank if the directory does not exist -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "ira " wrote in message ... I try to save the file. I'd like to prevent the case when the path is wrong - Temp directory doesn't exist - and show the warning by myself. ex. ThisWorkbook.SaveAs C:\Temp\1.xls --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Check to see if a value exists in a list? | Excel Worksheet Functions | |||
Check if file exists | Excel Discussion (Misc queries) | |||
Check if directory empty OR no of files in directory. | Excel Programming | |||
Check to see if cell value exists | Excel Programming | |||
Verify a directory exists | Excel Programming |