Missing VBA Reference
Posted by Dan on January 03, 2002 9:14 AM
I have a workbook with a recorded macro (that was slightly modified) that copies and pastes a new worksheet. It works fine, except on a couple of other peoples' computers that gets a 1004 runtime error: "Copy method of Worksheet class failed". When I check their VBA References, it shows "MISSING: Microsoft Office 8.0 Object Library"
I also noticed that these people are unable to record a new macro, even on a new workbook, getting the message "Unable to record".
I checked MS's web site, and did what it said (uncheck the missing references, ran a macro "fix" to remove references) but I still have the problem. Any ideas?
Here's the macro:
Sub AddTimeCardSheet()
'
'
Sheets("Template").Select
Sheets("Template").Copy Before:=Sheet ("Template") 'this is where the error occurs
ActiveSheet.Unprotect
Range("F2:L3,S2,B6,B10:O11,D14:J14,D16:J16,O14,O16").Select
Selection.Locked = False
'Unlocks entry fields
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
'Protects worksheet
Range("B6").Select
End Sub