Hi guys,
first thanks to all of you who take part in this community, this is my first ever post but I've been lurking around and learning a lot from the content I see here.
Now on with the question,
I have created a workbook with Macros in it which used to run fine for the first 400 or so sheets. Now I'm at over 650 and Excel randomly stops responding upon data entry after running one macro which hasn't changed since the beginning.
It can go on for a few days without a single hiccup and then it can crash 5 times in a single day... I tried it on different PC's even very powerful ones and it still happens therefore I don't think it's a memory issue.
I also tried to export and reimport my code following this procedure https://exceleratorbi.com.au/excel-keeps-crashing-check-your-vba-code/
however it still crashes.
Here's the said macro :
Do you guys see anything wrong with it that could explain my random problem?
Thanks,
first thanks to all of you who take part in this community, this is my first ever post but I've been lurking around and learning a lot from the content I see here.
Now on with the question,
I have created a workbook with Macros in it which used to run fine for the first 400 or so sheets. Now I'm at over 650 and Excel randomly stops responding upon data entry after running one macro which hasn't changed since the beginning.
It can go on for a few days without a single hiccup and then it can crash 5 times in a single day... I tried it on different PC's even very powerful ones and it still happens therefore I don't think it's a memory issue.
I also tried to export and reimport my code following this procedure https://exceleratorbi.com.au/excel-keeps-crashing-check-your-vba-code/
however it still crashes.
Here's the said macro :
Code:
Sub NouvellePolice()'
' NouvellePolice Macro
'
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect Password:="TEST"
Sheets("Base_Police").Copy After:=Sheets(Sheets.Count)
ActiveWorkbook.Sheets("Base_Police (2)").Activate
Sheets("Base_Police (2)").Range("K73").Value = Range("D1").Value
Sheets("Base_Police (2)").Range("K74").Value = Range("D2").Value
Sheets("Base_Police (2)").Range("K75").Value = Range("D6").Value
Sheets("Base_Police (2)").Name = Sheets("DataPolices").Range("B1")
ActiveWorkbook.Sheets("DataPolices").Activate
Sheets("DataPolices").Range("B" & Rows.Count).End(xlUp).Offset(1).Value = Range("B1").Value
Sheets("DataPolices").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Range("A1").Value
Worksheets(Worksheets.Count).Visible = True
Worksheets(Worksheets.Count).Select
ActiveWorkbook.Protect Password:="TEST", Structure:=True
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End
End Sub
Do you guys see anything wrong with it that could explain my random problem?
Thanks,