VBA Memory/Macro Problems

bfarms

New Member
Joined
Nov 15, 2012
Messages
11
I have been successfully using a macro that I learned here a few years ago but it stopped working. It doesn't show up in Macros anymore and I can't open the editor by using Alt+F11. When I try, it says out of memory.
Now, this is affecting every Excel workbook I am in--which do not have their own Macros. An error pops up in the other workbooks that says Can't find project or library (Visual Basic for Applications) after I hit okay, a dialog box called "References-VBA Project" pops up.

This is my macro: (to print a page # on each sheet)

[TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl140, width: 64"]Sub PgNumbs()[/TD]
[/TR]
[TR]
[TD="class: xl140"] For i = 1 To 50[/TD]
[/TR]
[TR]
[TD="class: xl140"] With Sheets("WorkOrders")[/TD]
[/TR]
[TR]
[TD="class: xl140"] .PageSetup.RightHeader = "Page " & i[/TD]
[/TR]
[TR]
[TD="class: xl140"] .PageSetup.FitToPagesWide = 1[/TD]
[/TR]
[TR]
[TD="class: xl140"] .PageSetup.FitToPagesTall = 1[/TD]
[/TR]
[TR]
[TD="class: xl140"] .PrintOut Copies:=1[/TD]
[/TR]
[TR]
[TD="class: xl140"] End With[/TD]
[/TR]
[TR]
[TD="class: xl140"] Next[/TD]
[/TR]
[TR]
[TD="class: xl141"] end sub[/TD]
[/TR]
</tbody>[/TABLE]


Anyone have any ideas to help? I am not a proficient Macro user but was so happy to learn from everyone here and help out with a weekly chore by way of a macro. Thanks !
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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