Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Checking 2 c if workbook exists

I have two spreadsheets, one saved on a floppy disk called
demo.xls and one stored on the c drive called master.xls,
what i would like to do is to get master.xls to check
whether demo.xls exists on the floppy disk. how do i do
this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Checking 2 c if workbook exists

if dir("A:\demo.xls")<"" then
' file exists
else
' file does not exist
End if

--
Regards,
Tom Ogilvy

"DavidMc" wrote in message
...
I have two spreadsheets, one saved on a floppy disk called
demo.xls and one stored on the c drive called master.xls,
what i would like to do is to get master.xls to check
whether demo.xls exists on the floppy disk. how do i do
this?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Checking 2 c if workbook exists

Crashes out with Runtime error 52: bad filename or number.


-----Original Message-----
David,

Use Dir. For instance

If Len(Dir("C:\WINDOWS\WIN.INI")) 0 Then
MsgBox "Found"
End If


--

HTH

Bob Phillips

"DavidMc" wrote in message
...
I have two spreadsheets, one saved on a floppy disk

called
demo.xls and one stored on the c drive called

master.xls,
what i would like to do is to get master.xls to check
whether demo.xls exists on the floppy disk. how do i do
this?



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Checking 2 c if workbook exists

David,

It's OK for me (XP2002, XL2000). Did you copy it or type it afresh?

--

HTH

Bob Phillips

"DavidMc" wrote in message
...
Crashes out with Runtime error 52: bad filename or number.


-----Original Message-----
David,

Use Dir. For instance

If Len(Dir("C:\WINDOWS\WIN.INI")) 0 Then
MsgBox "Found"
End If


--

HTH

Bob Phillips

"DavidMc" wrote in message
...
I have two spreadsheets, one saved on a floppy disk

called
demo.xls and one stored on the c drive called

master.xls,
what i would like to do is to get master.xls to check
whether demo.xls exists on the floppy disk. how do i do
this?



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Checking 2 c if workbook exists

I get that error if there is no disk in the floppy drive:

dir("A:\*.*")


Sub CheckDemo()
On Error GoTo ErrHandler
tryAgain:
sFile = Dir("A:\demo.xls")
If sFile = "" Then
MsgBox "Put disk with demo.xls in the floppy drive"
End If
Exit Sub
ErrHandler:
If Err.Number = 52 Then
MsgBox "Please put a floppy in the drive and hit enter"
Resume tryAgain
End If
End Sub


--
Regards,
Tom Ogilvy


"DavidMc" wrote in message
...
Crashes out with Runtime error 52: bad filename or number.


-----Original Message-----
David,

Use Dir. For instance

If Len(Dir("C:\WINDOWS\WIN.INI")) 0 Then
MsgBox "Found"
End If


--

HTH

Bob Phillips

"DavidMc" wrote in message
...
I have two spreadsheets, one saved on a floppy disk

called
demo.xls and one stored on the c drive called

master.xls,
what i would like to do is to get master.xls to check
whether demo.xls exists on the floppy disk. how do i do
this?



.



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking to see if a file exists. JHB Excel Discussion (Misc queries) 3 August 5th 09 03:11 PM
Already exists on the destination workbook ChrisP Excel Worksheet Functions 3 July 11th 08 08:13 PM
Checking if Sheet Exists? [email protected] Excel Discussion (Misc queries) 5 September 1st 06 03:27 PM
Checking to see that a CHART exists prior to running a simple command Anton Excel Discussion (Misc queries) 0 August 29th 06 06:30 AM
Determining if a worksheet exists within a workbook Cory Schneider Excel Programming 1 July 17th 03 12:36 AM


All times are GMT +1. The time now is 02:11 AM.

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"