Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a 'admin' sheet where the workbook 'owner' can select which
external files to update -- this is done by setting the value in a specific cell to 'yes' (via Validation). I've built the code to update the specific file, but need to add code that will test to see if that file is even available! Here's the code so far: ************ For Each r In Union(Worksheets("ADMIN").Range("c16:c34"), Worksheets("ADMIN").Range("I16:I33")) If LCase(r) = "yes" Then Sto = r.Offset(0, -1).Value Sto = Format(Sto, "000") If Dir(Path & "Ops Update_Store" & Sto & ".xls") < "" Then Else Call MsgBox("Store " & Sto & " did not submit an update!", vbExclamation, "Request Denied ....") End If Set mybook = Workbooks.Open(Path & "Ops Update_Store" & Sto & ".xls", 0, True) ...... etc, etc, etc .... ************ You'll notice that I made an attempt to figure it out .... and the msgbox appears when the file isn't available, BUT then continues on to try to open the non-existent file, causing an error. I want the code to display the msgbox and then continue to the next 'r' (if there is one). Any ideas? thanks, ray |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How does one name, for instance, A1 as 'last name?' | New Users to Excel | |||
First Instance | Excel Discussion (Misc queries) | |||
How do I get one instance of Excel to communicate with another instance? | Excel Programming | |||
How do I get rid of a 2nd instance (xls:2)? | Excel Discussion (Misc queries) | |||
xl instance | Excel Programming |