Hi Guys,
I have a simple macro that opens and saves the file as the next running number in cell I3. It has been working for the past 3-4 months and suddenly 3-4 days ago, it just suddenly started to behave differently. Now whenever the file is open it opens 2 files. However when I already have excel opened in the background, it stops triggering twice and does it once like normal. I have not amended the macro in anyway 3-4 days ago and am really lost on why it suddenly started behaving like this and how do I return it to normal (by triggering just once)?
Any help would be greatly appreciated.
Sorry that I crossposted as i wasn't aware that excelforum.com and ozgrid.com is the same forum. My apologies for not putting the code with the
Code
. I hope that I have done it right this time. I have tried debugging it and been googling it for the past 2 days.
I have deleted the other post in excelforum. no more cross posting
Thanks.
[CODE]Private Sub Workbook_BeforeClose(Cancel As Boolean)
End Sub
Private Sub Workbook_Open()
If ActiveWorkbook.Name = "Service Work Order_Field Service.xlsm" Then
Sheets("Service Order").Range("I3").Value = Sheets("Service Order").Range("I3").Value + 1
ThisWorkbook.Save
ThisFile = Range("I3").Value
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\.." & ThisFile & ".xlsm"
End If
End Sub
Display More