Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Run Time Error

I have a file that when macros are enabled provides me
with a "Run Time Error 5". When I debug it takes me to a
line of code that reads
Set wb = Workbooks.Open("U:\Quality Team\QA MAIN\Analysis
and ReportsLG KL GN\Corporate Excel Reports\QARP2004
\ProgramReports\PG1Rep2004.xls")

The path is correct.

Here is the complete sub

Private Sub Workbook_Open()

Dim wb As Workbook
Dim lngColor As Long
lngColor = RGB(221, 221, 221)
ActiveWorkbook.Colors(16) = lngColor
Sheets("SR").Select
Application.Goto Reference:=Worksheets("Front").Range
("A1"), Scroll:=True
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Borders").Visible = False
Application.CommandBars("Chart").Visible = False
Application.CommandBars("Control ToolBox").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.CommandBars("Clipboard").Visible = False
Application.CommandBars("External Data").Visible = False
Application.CommandBars("Forms").Visible = False

Application.CommandBars("Picture").Visible = False
Application.CommandBars("PivotTable").Visible = False

Application.CommandBars("Reviewing").Visible = False

Application.CommandBars("Visual Basic").Visible = False

Application.CommandBars("Web").Visible = False
Application.CommandBars("WordArt").Visible = False
Application.CommandBars("Standard").Visible = True

Application.ScreenUpdating = False ' turn off the screen
updating
Set wb = Workbooks.Open("U:\Quality Team\QA MAIN\Analysis
and ReportsLG KL GN\Corporate Excel Reports\QARP2004
\ProgramReports\PG1Rep2004.xls")
With ThisWorkbook.Worksheets("Front")
..Range("A8").Value = wbz.Worksheets("Objectives").Range
("F2").Value

wb.Close False
Application.ScreenUpdating = True ' turn on the screen
updating

End With
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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM
Run-time error '11' & Run-time error '1004' Piers Clinton-Tarestad Excel Programming 0 January 9th 04 08:35 PM
Run-time error '11' & Run-time error '1004' Piers Clinton-Tarestad Excel Programming 0 January 9th 04 07:45 PM


All times are GMT +1. The time now is 04:45 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"