Accept/Decline Dialog box
Your problem is that if you can't run the macro then you can't enforce your
conditions, and the user decides whether to let you run the macro. I would
use an intermediate workbook to solve this. Put your code in the "Intro"
workbook that gives them the condition. If they agree to the macro and to
the condition, then your code opens the 2nd workbook. If they agree to the
macro but not the condition, it closes the "Intro" workbook and nothing else
happens. If they don't agree to running the macro, they are only left with
an empty spreadsheet that does no harm. This would be very easy. The only
tricky part is that once they see the 2nd workbook once, they could get to
it a second time without agreeing to anything by opening it directly, unless
you place it in a place or in a way that only the "Intro" macro (or
yourself) can get to it. I suppose a password would be one solution, where
the "Intro" macro knows the password but the user would not.
Richard Choate, CPA
> I want to display a dialog box on opening a file with a
> Condition and allow the user to accept/decline opening of
> the excel file. If accept then the sheet opens normally,
> if decline then the sheet closes.
> I have written something but excel always prompts with a
> macro virus warning message. If the disable macros option
> is selected, the worksheet opens and I don't want this to
> happen. Can anyone suggest a way of doing this?
> Thanks very much
> Best Regards