View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Héctor Miguel Héctor Miguel is offline
external usenet poster
 
Posts: 434
Default Why am I getting 2nd macro security warning?

hi, joe !

__ 1 __
I get the "Excel 4.0 macros" warning in addition to the normal "Disable/Enable Macros" warning
due to the "medium" macro security.
In the original "bad" workbook, the "Disable/Enable Macros" warning pops up
before any of the worksheet contents, as expected.
Then the "Excel 4.0 macros" warning pops up just after the worksheet contents appear.


1) apparently your macros are trying to make "calls" to XL-4 macros (in someway/somehow)
perhaps opening (other) workbook/s which contains macrosheets (and/or)
containing references to workbooks/addins/... with (or written in) XL-4 macro-functions language

- previously you commented that your macros makes some calls to ATP & Solver functions (so...)
check in your vba-project for any reference pointing to addins (xla) that could it be from earlier versions

__ 2 __
AFAIK the second warning arises (only) if your workbook (the "bad" one ?):
- contains (normal/international) "MacroSheets" type (work)sheets
- and/or IF... (for any reason) excel "attempts" to read/interpret...
(some) cell's content as a macro-function (from the ancient xl4 macro language)


I'm afraid I do not know what any of that is.
But that does not mean I couldn't stumble into creating those because of something that I did inadvertently.
A google search did not immediately help me understand this.
I confess I did not read very deeply.


2) a macrosheet can easily (and inadvertedly) be added to your workbook with a short-cut key: - {ctrl}+{F11}
an empty macrosheet could be enough to get the "normal" macro warning (the first one) message
if a macrosheet is hidden (suppose xlSheetVeryHidden) can not be "viewed" (even through vba editor)
however, "macros" in macrosheets are "named-ranges" (either as functions or commands)

__ 3__
But if you are suggesting that the problem has to do with a worksheet
wouldn't you expect the problem to go away after I deleted all of the worksheets
(and added a new blank one to avoid closing the workbook summarily)?


3) that's correct, unless... the excel 4 macros comes from any "opening" workbook (by your normal macros)

__ 4 __
All of the "MS Excel Objects" are blank. Module1 and Module2 contain my macros.
This is similar to the new workbook, into which I cut-and-pasted the contents of Module1 and Module2.
When I open the new workbook, I get only the one expected "Disable/Enable Macros" dialog box.
The only "obvious" Project Explorer differences between the "bad" and the new workbook is that in the "bad" workbook
I named the project VBAbinary -- a unique name that permits me to reference in other workbooks.
Another difference is that the worksheets in the "new" workbook are all empty
whereas I have formulas in worksheets in the 'bad" workbook that refer to functions in Module1 and Module2.


4) no comments... that's the way it should be

__ 5 __
But I always had function references in the "bad" workbook, and previously
they did not cause the additional "Excel 4.0 macros" dialog box, which I want to avoid.


5) believe me, the "excel 4 macros warning", there is no way to arise...
IF NO excel 4 macros are to be opened in the excel session (not necessarily in your workbook)
- macrosheets / names
- "opening" workbooks/addins (with either calls to or written in the excel 4 macro language)
- (like) macro-functions (text) in your (macro)sheets cells

if any doubts (or further information)... would you please comment ?
hth,
hector.