Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Option Explicit Sub test() Dim bGotIt As Boolean Dim sFile As String Dim sPath As String Dim testStr As String sFile = "Book1.xls" sPath = "a:\temp\" testStr = "" On Error Resume Next bGotIt = (Len(testStr) 0) On Error GoTo 0 MsgBox bGotIt End Sub ceemo wrote: This works great but if i am pointing to th a: drive and there isnt a floppy in it the macro will fall over. Is there anyway arond this? Sub test() Dim bGotIt As Boolean Dim sFile As String Dim sPath As String sFile = "Book1.xls" sPath = "c:\temp\" 'On Error Resume Next bGotIt = (LCase(sFile) = LCase(Dir(sPath & sFile))) 'On Error GoTo 0 MsgBox bGotIt End Sub -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=400396 -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User replaces existing file with blank during file open | Excel Discussion (Misc queries) | |||
Importing text file, only option to edit existing file | Excel Discussion (Misc queries) | |||
Creating a new excel file from an existing file using macro | Excel Programming | |||
can i save an existing .xls file as a .csv file using command line | Excel Discussion (Misc queries) | |||
get path - save new file - same sub-directory as existing file | Excel Programming |