Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming | |||
Run-time error '11' & Run-time error '1004' | Excel Programming | |||
Run-time error '11' & Run-time error '1004' | Excel Programming |