Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 57121 error, but not a Mac in sight

Hi folks

I have a very simple workbook open event that elicits a 57121 error message
whenever it runs. All the articles in knowledge base relating to this debug
code involve Macs, but I can absolutely guarantee that this spreadsheet has
never been near a Mac.

If you run the code independently (i.e. not as a workbook open event), it's
fine, and it also worked perfectly in previous editions of the workbook
(Excel 2000).

The code in question is:

Private Sub Workbook_Open()
If Sheets("Price").Range("J64") = 1 And Sheets("Price").Range("J66")
= 1 Then
Disable_SaveAs
End If
End Sub

The code hangs on the IF statement line.

Disable_SaveAs is a nice simple routine to stop people making numerous
copies of the spreadsheet once certain criteria are met:

Sub Disable_SaveAs()

CommandBars("File").Controls.Item("Save As...").Enabled = False

'Disable Right click option on Toolbars
CommandBars("ToolBar List").Enabled = False

'To disable the selection of the Save as icon
'available via Right click / Tools / customize.
CommandBars("Tools").Controls.Item("Customize...") .Enabled = False


Dim iOKOnly As Integer

iOKOnly = MsgBox("SaveAs is disabled on this worksheet to prevent" &
vbCrLf & "coded budgets being replicated." & vbCrLf & vbCrLf & "Please use a
new budget form for your new project.", vbOKOnly Or vbCritical)

If iOKOnly = vbOK Then
Exit Sub
End If

End Sub

Any help on this is welcome.

Thanks!

(PS: the SaveAs function is re-enabled on "workbook before close", in case
you were wondering...)
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
Eye-sight and errors James Silverton[_3_] Excel Discussion (Misc queries) 0 July 16th 08 04:03 PM
Runtime error 57121 Dave Peterson Excel Discussion (Misc queries) 1 February 26th 08 10:51 AM
Run-Time error 57121 Linking to specific cells in pivot table Excel Programming 0 June 23rd 05 07:20 PM
###Error 57121### Jimmy Excel Programming 2 November 10th 04 02:00 PM
error 57121 toine Excel Programming 0 December 29th 03 10:10 PM


All times are GMT +1. The time now is 02:24 AM.

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

About Us

"It's about Microsoft Excel"