Terje Isaksen Developer blog

2011-06-21 (Tuesday)

Excel tips and tricks

Filed under: Developing — Terje Isaksen @ 14:40

New function in Excel 2007:

=IFERROR(expression; safevalue)

If something is wrong, giving #ERROR och #VALUE – the safevalue is used. Combination of IF() and ISERROR()

To prevent user from saving workbook:

Private Sub Workbook_BeforeSave (ByVal SaveAsUI As Boolean, Cancel As Boolean) 
    '  Following line will prevent all saving
    Cancel = True
    '  Following line will prevent the Save As Dialog box from showing
    If SaveAsUI then SaveAsUI = False
End Sub

Source: http://www.ozgrid.com/forum/showthread.php?t=26224&p=133079#post133079

To be able to save this anyway, go to Developer tab and click on Design Mode – then macros will not run, and you are able to save.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at WordPress.com.

%d bloggers like this: