Reset Project?

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,855
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
Hello guys

Something not really a problem but annoying.
It happened before, but the current situation is as follows:

have a Workbook - sheet with ActiveX buttons for calling some UserForms - it's all in a development stage (so it is frequently tested, changed, code editing, etc.)
When i try to change a form design (View Object) or edit the code or sometimes even when i save the file i get this message and it strated getting on my nerves:
"This Action will reset your project. Continue anyway?"

i got somehow to a conclusion that it is connected with the buttons in the sheet or with the sheet code but not really sure what it is all about.

WTH does this mean? Why i get this message? Any ideas and solutions very much appreciated?

Thanks in advance
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

WaterGypsy

Well-known Member
Joined
Jan 15, 2010
Messages
697
I think it means that you were running code and it stopped for some reason .... either a bug or a program interrupt ... and the change you ar emaking means that it won't continue to run if you press the run button
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Have you had an error while running your code? Run|Reset from the menu exits debug mode (clears the yellow highlight from the line that caused the error).
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,855
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
Yes i was running code but no error stopping or something like this. Surely am not in debug mode.

Showing a few forms, pressing some buttons, closing the forms.
then go to VBE, 2xClick on the form to adjust the design and then it pops up ...

am i not closing the forms properly?
is there a way to check if something is left in the memory - or if something is running somewhere in the backgound?
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092

ADVERTISEMENT

How are you "closing the form"?
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,855
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
option 1: close button "X"
option 2: Cancel button with Unload me in its Click event

the situation now is:
1. I open the form with the button from the sheet
UserForm1.Show
2. The form is opened - no code running
3. Then i just close the form in one
4. switch to VBE - double click on the form and i get this message

weird....
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,855
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows

ADVERTISEMENT

Wow ! As so often - i was looking in the wrong direction. :)
it just turned out that the problem is somewhere else - i have another file with some code auto-opened by excel - i closed it and the problem disappeared.
The strange thing is i didn't start any piece of code from it (not manually) and didn't get any error messages and was not in debug mode (AFAIK).
So now i should go back a few posts behind:
is there a way to check if something is left hanging in the memory - or if something is running somewhere in the backgound? or some errors left behind and not cleared?
 

ZVI

MrExcel MVP
Joined
Apr 9, 2008
Messages
3,847
Office Version
  1. 2019
  2. 2016
  3. 2010
Platform
  1. Windows
Hi,
Just for your attention - it would be curiously to know that when you add or remove ActiveX control into/from the sheet then VBA project resets anyway. This means that all global/static/module_level variables reset to it's initial values.

To test this behavior follow the instructions in the comments of example below :
Rich (BB code):

Dim MyVar As Long

Sub Init()
  MyVar = 123
End Sub

' 1. Run Init to set module variable MyVar = 123
' 2. Run Test: message box appears with MyVar = 123
' 3. Add (manualy) ActiveX to the sheet - the project resets,
'    that is: all global/static/module_level variables reset to it's initial values.
' 4. Run Test: message box appears with MyVar = 0 because variable resets
Sub test()
  MsgBox "MyVar = " & MyVar
End Sub
Regards
 
Last edited:

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
8,388
Office Version
  1. 2016
Platform
  1. Windows
Hi,
Just for your attention - it would be curiously to know that when you add or remove ActiveX control into/from the sheet then VBA project resets anyway. This means that all global/static/module_level variables reset to it's initial values.

To test this behavior follow the instructions in the comments of example below :
Rich (BB code):
Dim MyVar As Long
 
Sub Init()
MyVar = 123
End Sub
 
' 1. Run Init to set module variable MyVar = 123
' 2. Run Test: message box appears with MyVar = 123
' 3. Add (manualy) ActiveX to the sheet - the project resets,
'    that is: all global/static/module_level variables reset to it's initial values.
' 4. Run Test: message box appears with MyVar = 0 because variable resets
Sub test()
MsgBox "MyVar = " & MyVar
End Sub
Regards

Vladimir.

Funny that you should bring this up now because only yesterday I came up with this trick that prevents resetting global variables when adding ActiveX Controls to a worksheet.
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,855
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
OK - this good to know - thanks for the tip.
But is it possible to check what causes this message to appear - is something still resident in the memory, what's running - after this reset i only open and close a form and then it pops again ???

and 1 more thing i just noticed - in VBE the properties window is closed each time i start Excel - is it connected or not?
 
Last edited:

Forum statistics

Threads
1,148,173
Messages
5,745,183
Members
423,931
Latest member
thangvan114

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
Top