January 30, 2020
Run-time error '-2147319767 (80028029)':
Automation error
Invalid forward reference, or reference to uncompiled type.
The error above is what I'm getting when going to another sheet via macro.
Below is code. the last entry in red is what is giving me the error. It used to work for a couple years now, just happened to not work all of the sudden and not sure what the cause is. Any macro with moving to a different sheet is causing this as well. Some works, some don't not exactly consistent.
Columns("I:I").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("G3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Range("I3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("I5").Select
Columns("Q:Q").Select
Selection.Columns.Group
Range("I5").Select
Sheets("Control Panel").Select
Thanks in advance for the help!
October 5, 2010
Hi Kenneth,
A quick search indicates this could be fixed by declaring a sheet object and manipulating that:
Sub SetSheet()
Dim cp As Worksheet
Set cp = Sheets("Control Panel")
cp.Activate
End Sub
NOTE: When switching sheets I'd use Activate not Select.
P.S. If you need further help, please attach your workbook.
Regards
Phil
Answers Post
1 Guest(s)