Macro error

Jeeremy7

Board Regular
Joined
May 13, 2020
Messages
110
Office Version
  1. 365
Platform
  1. Windows
Hello,

I created a macro that was working just fine and for some reason it decided not to work anymore.
The error is:
Run-time error '-2147319767 (80028029)
Automatic error
Invalid forward reference, or reference to uncompiled type.

When I check debug it shows me the line there only calls a sheets.
sheets("XXX").Select

Not to sure why this error just appeared.
I saw that it could be because of VB6.0 but I have no Idea how to fix it as I do need to call that sheet..

Thanks !

Edit:
I also realised that the macros are in visual basic but don't appear when I press the macros button
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Even though that line was highlighted, the error could be introduced somewhere else. Please show all of the code. Also consider applying code tags for better readability. Paste in the code, selected the code, click the VBA button on the edit controls.
 
Upvote 0
That was the problem.
For some reason instead of putting sheets("XXX").Select I put sheet1.select and it worked. Very weird but it is what it is (I re typed the sheet name to make sure and the lag was still there, only for that specific sheet)
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top