Hi!
Try this in Excel 2007:
First make sure Macro settings is - "Inactivate all macros and show a
message".
That is how the users Excel is set. I can't change that.
(I have a Swedish Office so I don't know the exact frase in english)

Create two (or more) books with the following code.

Private Sub Workbook_Open()
    MsgBox ThisWorkbook.VBProject.Filename
End Sub

Make sure Excel is closed.
Open the 1:st file.
You will now get a message in the toolbar like
"Security warning   Macros has been deactivated [Options]"
Now open the 2:nd file.
You'll get the same message again.

Now you can't get any of the books to work with macros.
Ok - macros work but nothing with ThisWorkbbok.VBProject - and that is
what I need.
Try click the [Options] in the info bar and select to activate content
and you'll get "Method VBProject of object Workbook Failed".

You have to activate macros in all books you open or the next book
will not work.
1:st file: Open - activate => ok
2:nd file: Open - activate => ok
3:rd file: Open - deactivate => ok
4:th file: Open - activate => fail

But - If you have Excel running and the code window visible and do the
same thing,
then you'll get a popup for each file where you can choose to
deactivate or active macros.
And everything works like it should just like in the good old days.

Does anyone know a way around this problem?
I really want this to work.

The code snippet is of course just an example. The real app is doing a
lot more.
Thanks in advance!

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,700 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to