Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
2003/2007
There is a probable a better way. The GoToWb opens at the '******* line of code. If the file has not opened by '$$$$$$$$$ line then I have the code line - If Err.Number 0 Then Workbooks(GoToWb).Activate If Err.Number 0 Then On Error GoTo 0 On Error Resume Next Set Windows(GoToWb) = Workbooks(GoToWb) On Error GoTo 0 On Error Resume Next Set Workbooks(GoToWb) = Workbooks.Open(Filename:=GoToPath & GoToWb) '******* On Error GoTo 0 On Error Resume Next Set Workbooks(GoToWb) = Workbooks.Open(Filename:=Application.DefaultFilePa th & _ "\" & GoToWb) '$$$$$$$$$ If Err.Number 0 Then ....... Endif Endif Since the file opens at '******* then the Set command at '$$$$$$$$$ produces an error when the file is already open. How do I test the success of the previous Set command so that I do not produce an error? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
inserting a conditional "go to" command on a excel "if" function | Excel Worksheet Functions | |||
Complex if test program possible? If "value" "value", paste "value" in another cell? | Excel Discussion (Misc queries) | |||
Debug.Print "Test " vbCodeLineNumber & ": " & varName | Excel Programming | |||
Is there a "replace" or "Substitute" command in Excel's VB? | Excel Programming | |||
Looking for VB code to test for "RING" , "BUSY" disconnects or other signals | Excel Programming |