How is it possible that excel opens in break mode: how do i stop that

spurs

Active Member
Joined
Oct 18, 2006
Messages
448
I created an excel workbook years ago that had some code in the this workbook module. General commands for updating ever entry sort of thing. It also calls a password check macro for verification. This has worked well for years.

The workbook was being used by my associate in China. Recently he sent me a copy back to work on and i cant open it the same way anymore.

As soon as the wordbook module runs on opening excel goes into break mode, and the password check macro doesnt run. The error is "cant execute code n break mode"

I can get into the original macro and see that as soon as i execute the first line:

Private Sub Workbook_Open()

in the workbook module, excel goes into break mode

I am suspicious that someone in China has tampered with the file to cause this; I have no idea where to look to resolve it.

I need the worksheet to run macros to calculate properly and i cant get it to do that atm
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

johnnyL

Well-known Member
Joined
Nov 7, 2011
Messages
1,499
Office Version
  1. 2013
  2. 2007
Platform
  1. Windows
post your complete code
 

johnnyL

Well-known Member
Joined
Nov 7, 2011
Messages
1,499
Office Version
  1. 2013
  2. 2007
Platform
  1. Windows
You might also try putting the code into a module instead of a worksheet, if you don't have it that way already.
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,029
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
Press ALT + F11 and look at the Workbook_Open event.
See if there is a line highlighted.
If so, end the macro>>Save>>close and see if it works.
But as @johnnyL as stated, it would help to see the codes
 

spurs

Active Member
Joined
Oct 18, 2006
Messages
448
I think i have resolved the issue.
The file is a .xls file
When the file was returned to me from our affiliate in China, i opened it directly without saving it first.
When I opened it i first get a request to enable macros which i accept and then i get the following error before the license check happens during the workbook open event

Run time error 1004
Method OnTime of object application failed

To troubleshoot this I saved the file to my system, and being .xls it warns me of compatibility issues on saving which i accept

After saving and reopening from my own system, the run time error does not occur

I assume its a compatibility issue that is resolved by saving first
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
59,550
Office Version
  1. 365
Platform
  1. Windows
Assuming that you are not using a really old version of Excel, I would recommend saving as an "xlsm" or "xlsb", which are the Excel file types that allow VBA (since 2003).

By the way, you should update your Profile to show us which version of Office you are using (like you see with mine).
This is often helpful, if people know which version you are running.
 

Forum statistics

Threads
1,144,676
Messages
5,725,710
Members
422,636
Latest member
GatorsBucs

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