Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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
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
when i open an Excell file 3 workbooks open.Why? Iain40 Excel Discussion (Misc queries) 2 February 3rd 09 05:04 PM
halt a subroutine question teepee[_3_] Excel Discussion (Misc queries) 3 December 28th 08 09:23 PM
When I open Excel, workbooks open automatically. How can I stop t Rhealbird Excel Discussion (Misc queries) 2 February 23rd 06 10:08 AM
Workbooks.Open closes other workbooks S. Daum Excel Programming 1 August 21st 03 07:47 PM
Workbooks.Open / .Open Text - How do you stop the .xls addition? Dave[_20_] Excel Programming 2 July 31st 03 04:03 AM


All times are GMT +1. The time now is 11:05 PM.

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"