Hi,
Is there any way of creating some form of copyright message that pops up when a user opens a particular workbook? They then have to agree to the terms to enter.
Thanks,
Mark.
Hi,
Is there any way of creating some form of copyright message that pops up when a user opens a particular workbook? They then have to agree to the terms to enter.
Thanks,
Mark.
Not foolproof but one way
Private Sub Workbook_Open()
ans = MsgBox("© MEvetts", vbOKCancel)
If ans = vbCancel Then
ThisWorkbook.Close savechanges:=False
End If
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
"mevetts" <[email protected]> wrote in
message news:[email protected]...
>
> Hi,
>
> Is there any way of creating some form of copyright message that pops
> up when a user opens a particular workbook? They then have to agree to
> the terms to enter.
>
> Thanks,
>
> Mark.
>
>
> --
> mevetts
>
>
> ------------------------------------------------------------------------
> mevetts's Profile:
http://www.excelforum.com/member.php...o&userid=29130
> View this thread: http://www.excelforum.com/showthread...hreadid=496603
>
Hi,
I have pasted the code in, but I get an error message in Visual Basic when I open the workbook.
It says - 'Compile error: Ambigious name detected: Workbook_Open'
Any thoughts?
You only get one workbook_open event.
So you'll have to extract Bob's code and merge it into your existing
workbook_open routine.
mevetts wrote:
>
> Hi,
>
> I have pasted the code in, but I get an error message in Visual Basic
> when I open the workbook.
>
> It says - 'Compile error: Ambigious name detected: Workbook_Open'
>
> Any thoughts?
>
> --
> mevetts
>
> ------------------------------------------------------------------------
> mevetts's Profile: http://www.excelforum.com/member.php...o&userid=29130
> View this thread: http://www.excelforum.com/showthread...hreadid=496603
--
Dave Peterson
Ah, ok. Thanks, will do.
It works nicely, thanks. It is dependent on the user enabling macros, but they need to do this anyway.
Thanks again.
If macros aren't enabled, then none of your macros will work. (You can't use
macros in the workbook to enable macros for that workbook.)
mevetts wrote:
>
> It works nicely, thanks. It is dependent on the user enabling macros,
> but they need to do this anyway.
>
> Thanks again.
>
> --
> mevetts
>
> ------------------------------------------------------------------------
> mevetts's Profile: http://www.excelforum.com/member.php...o&userid=29130
> View this thread: http://www.excelforum.com/showthread...hreadid=496603
--
Dave Peterson
Indeed.
Is there any way of creating a line break in the text?
I would like two short pieces of info in the pop up, but I don't know how to create a new paragraph. When I just hit enter in the code it turns the line to red and gives and error message!
Cheers.
Private Sub Workbook_Open()
ans = MsgBox("© MEvetts" & vblf & "second line" & vblf _
vblf & "another line", vbOKCancel)
If ans = vbCancel Then
ThisWorkbook.Close savechanges:=False
End If
End Sub
mevetts wrote:
>
> Is there any way of creating a line break in the text?
>
> I would like two short pieces of info in the pop up, but I don't know
> how to create a new paragraph. When I just hit enter in the code it
> turns the line to red and gives and error message!
>
> Cheers.
>
> --
> mevetts
>
> ------------------------------------------------------------------------
> mevetts's Profile: http://www.excelforum.com/member.php...o&userid=29130
> View this thread: http://www.excelforum.com/showthread...hreadid=496603
--
Dave Peterson
Thanks Dave, I've soooo much to learn!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks