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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,225,747
Messages
6,186,792
Members
453,371
Latest member
HMX180

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