PDA

View Full Version : Can I block an .xlsm from being converted when it's open in Excel 2003



frank_m
03-19-2011, 09:30 AM
I have an .xlsm workbook that produces critical errors if a user opens in Excel 2003 that has the Microsoft Office Compatibility Pack installed.

Is there a way that I can prevent the conversion from happening and instead just present the user with a msgbox informing them that this workbook can only be read in Excel 2007

frank_m
03-19-2011, 03:16 PM
I'm going to conclude here that this cannot be done, because in my test the conversion takes place before any event code runs.
Makes perfect sense that it would need to be that way really... I was just hoping.
If Application.Version <> "12.0" Then

MsgBox "Cannot open this workbook in Excel 2003"

Application.ThisWorkbook.Close

End If The error is cannot execute design mode because command button1 has not been created.(a little odd being that command button1 does exist)
- - It would be ok if the user could then easily close the file.. unfortunately they can't... "can't" by normal methods I mean.

Guess we'll have to live with it.

mikerickson
03-19-2011, 05:15 PM
What is the source of those errors?
If the workbook is opened without macros, how bad is that?

What I'm thinking is that a Workbook_Open event could be written to test if the user has Excel 2004 (or do the critical errors also effect Excel 2011). In either case, a MsgBox would appear. This, combined with conditional formatting, would give notice to the Mac user that they aren't getting all the features of your workbook, but not stop them entirely.

frank_m
03-19-2011, 05:40 PM
Thanks for taking a look at this.

I'm not actually working with a Mac. Its Excel 2003 in Windows, trying to open a 2007 .xlsm

I don't mind the errors, other than the fact that the error dialog box gets caught for awhile in a repeating loop, making cntrl > pause break > kill excel, the only quick way to close it. - There is no option given to open the file without macros.

The file can be saved from 2007 as an .xls Excel 2003 file and all the macros work fine.... the issue has to be with the Microsoft Office Compatibility conversion tool, which runs before Excels Open Event.

The only error message I get is: "cannot execute design mode because command button1 has not been created"

(I would just keep using the 2003 .xls format, except for the fact that I soon will be adding a customized ribbon)

mikerickson
03-20-2011, 08:15 AM
Hmm. it sounds like you are using an ActiveX command button, have you tried using one from the Forms menu instead?

shrivallabha
03-20-2011, 08:37 AM
Hi Frank,

This ActiveX and Forms button business can really give pain. Here is one instance when I inadvertantly made a smart(?) decision to use an ActiveX (Calendar Control Precisely) and ended up with errors.
http://www.vbaexpress.com/forum/showthread.php?t=35548

However, there are some possible bypasses to this.
1. The obvious, not using the ActiveX.
2. I have not read any documentation in this regard but do remember a small fragment: You need to register the specific *.OCX (or was it a *.DLL) that corressponds to the button you have used on that machine.

Hth,