Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default SaveAs Question

I was wondering if there was amethod of capturing the SaveAs and disabling it
before the user tries to use it? I have this code for the Save but it still
allows the user to use SaveAs.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Application.UserName < "rcj" Then

Cancel = True
MsgBox "Sorry, But You Don't Have Permission To Save This File",
vbExclamation, "Invalid Permission"

End If

'MsgBox Application.UserName

End Sub


Thanks In Advance,
Rob
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default SaveAs Question

This should stop any File|Save or File|SaveAs.

Maybe you turned off events (application.enableevents = false) and forgot to
reenable it???

Or maybe the workbook was opened and macros were disabled???

Rob wrote:

I was wondering if there was amethod of capturing the SaveAs and disabling it
before the user tries to use it? I have this code for the Save but it still
allows the user to use SaveAs.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Application.UserName < "rcj" Then

Cancel = True
MsgBox "Sorry, But You Don't Have Permission To Save This File",
vbExclamation, "Invalid Permission"

End If

'MsgBox Application.UserName

End Sub

Thanks In Advance,
Rob


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default SaveAs Question

Sweet It Works. Thanks.

"Dave Peterson" wrote:

This should stop any File|Save or File|SaveAs.

Maybe you turned off events (application.enableevents = false) and forgot to
reenable it???

Or maybe the workbook was opened and macros were disabled???

Rob wrote:

I was wondering if there was amethod of capturing the SaveAs and disabling it
before the user tries to use it? I have this code for the Save but it still
allows the user to use SaveAs.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Application.UserName < "rcj" Then

Cancel = True
MsgBox "Sorry, But You Don't Have Permission To Save This File",
vbExclamation, "Invalid Permission"

End If

'MsgBox Application.UserName

End Sub

Thanks In Advance,
Rob


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saveas VBA question Lost Excel Discussion (Misc queries) 1 June 2nd 09 07:51 AM
Another SaveAs Question chipshot[_2_] Excel Programming 7 April 7th 06 06:58 PM
worksheet saveas question Jim Rech Excel Programming 1 March 30th 05 08:50 PM
SaveAs Question Greg Little Excel Programming 3 December 7th 04 02:37 AM
Question Using SaveAs Method R3df1sh Excel Programming 1 November 12th 03 07:26 PM


All times are GMT +1. The time now is 06:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"