Results 1 to 1 of 1

Only save via Macro linked to button

Threaded View

  1. #1
    Registered User
    Join Date
    03-12-2008
    Posts
    2

    Only save via Macro linked to button

    Hi,
    I'm a novice, and I have a spreadsheet that I want users to save only via a button on the worksheet. I have found code that prevents saving, which is great:-

    [code]
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    MsgBox "This workbook can ONLY be saved with the Save Button"
    Cancel = True

    End Sub
    [code/]

    but then my save as Macro wont work either...

    [code]
    Sub Saveasdate()

    Dim strName As String
    Dim strPath As String
    Application.DisplayAlerts = False

    strName = Range("AL3").Value
    strPath = ActiveWorkbook.Path
    ActiveWorkbook.SaveAs Filename:=strPath & "\" & strName, FileFormat:=xlNormal
    End Sub
    [code/]

    Can someone help me to do this better, or somehow turn saving back on when I need it?

    Thank you
    Last edited by Burley; 03-09-2009 at 05:27 AM. Reason: Solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1