View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ronald Dodge[_2_] Ronald Dodge[_2_] is offline
external usenet poster
 
Posts: 130
Default Macro - edit with macro

Why not setup a central workbook with explicit dates in it as the dates when
the workbook can print? Once you have this central workbook setup as such,
you will then have the individual workbooks refer to the central one to
check if it can be printed that day or not. This will avoid a lot of the
issues of having to deal with VBE coding and code trust issues.

Of course, this is assuming everyone using and may need to print the
workbook would have access to the central file.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000

"Danny" wrote in message
...
Hi,

I share a workbook with several sheets and macros with my officemates. I
have this macro so they cannot print any of the worksheets.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

However, when I out of town, and the reports needs to be printed, I'd like
to e-mail them another workbook to edit the macro above and replace it
with
the macro below.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Date < VBA.DateSerial(2007, 8, 17) Then
Cancel = True
End If
End Sub

The original workbook VBA Project Password is "OPENPW". Both workbooks
will
have the same VBA Project Password.

Thank you.