Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
workbooks().open halt
I have a command button on a user form to open a series of
workbooks. However, exectution halts after the workbooks (strFilNme).open line. I am NOT running this from a shortcut with a shift in it. Is there another command in VBA to open a workbook so I can work around this? Thanks, -John john.k.hannemann * ual.com ////// Call OpenWorksheet(strFilNme) ////// Sub OpenWorksheet(strFilNme As String) ' PURPOSE: Open chart file ' SUBROUTINE FLOW: Change drives/directories to where ' the charts are. Open the requested chart. On Error GoTo Errhandler ChDrive "S:" ChDir "S:\" ChDir "S:\TRAKTemp\Rolling6\ckin" Workbooks.Open Filename:=strFilNme, UpdateLinks:=0 Exit Sub Errhandler: Select Case Err Case 68, 75: ' Error 68: "Device not available" ' Error 75: "Path/File Access Error" MsgBox "There is an error reading drive B." Case 76: ' Error 76: "Path not found" MsgBox "The specified path is not found." Case Else: ' An error other than 68, 75 or 76 has occurred. ' Display the error number and the error text. MsgBox "Error # " & Err & " : " & Error(Err) End Select ' End the macro. End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
when i open an Excell file 3 workbooks open.Why? | Excel Discussion (Misc queries) | |||
halt a subroutine question | Excel Discussion (Misc queries) | |||
When I open Excel, workbooks open automatically. How can I stop t | Excel Discussion (Misc queries) | |||
Workbooks.Open closes other workbooks | Excel Programming | |||
Workbooks.Open / .Open Text - How do you stop the .xls addition? | Excel Programming |