Code now will not run

EddyStone

New Member
Joined
Jun 7, 2007
Messages
15
Using Excel on MAC (Latest)
My program worked fine a few days ago. I haven't done anything but now the start up macro fails.
The error is:-
Run Time Error '6'
Overflow

This is the code

Sub MG01Apr57()
Private Sub Workbook_Open()
Dim Ans As String
Ans = MsgBox("Update the Invoice Number", vbYesNo + vbInformation)
If Ans = vbYes Then
With Sheets("Invoice").Range("i6")
.Value = .Value + 1
End With
End If
ActiveWorkbook.Save
End Sub

I get the same error if I select either Y or N to update the Invoice Number.

All help welcome.
 
Just tried Joe and it was changing . Dim Ans As String to Dim Ans that solved the problem.

One for future reference for sure, sincere thanks again nice to know that guys like you are around to help us less knowledgable at writing macros :-)
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
You are welcome. I am glad we were able to figure it out.
Its a little tougher when we are using different versions of Excel, but I took my best guesses and we were able to "hit" on the right one!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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