Results 1 to 2 of 2

Saving Workbook in specified location, but as read only and compressed!

Threaded View

  1. #1
    Registered User
    Join Date
    04-24-2007
    Location
    Washington, England
    Posts
    14

    Saving Workbook in specified location, but as read only and compressed!

    Hello,

    I am not sure if this is possible but what I want to do is to create a macro which will prompt the user to insert a password to make the workbook read only, then save it to a specified location using a cell within this worksheet as the file name, but in a compressed format.

    I have a macro already which saves to a specified file name in a certain location but have no idea what to add to make it ask for a read only password and also to compress the file when saving.

    I have copied below my current macro and I will be very grateful is anyone can suggest a solution.

    Sub SaveFileAsDate()
    Dim WSName As String, CName As String, Directory As String, savename As String
    
    WSName = "XC Control Report Form"
    CName = "F8"
    Directory = "C:\Doc............\Test\"
    
    savename = Sheets(WSName).Range(CName).Text
    If Directory = "" Then Directory = CurDir & "\"
    On Error GoTo errorsub:
    ActiveWorkbook.SaveAs Filename:=Directory & savename & ".xls"
    Exit Sub
    errorsub:
    Beep
    MsgBox "Changes not saved!", vbExclamation, Title:=savename & ".xls"
    End Sub
    Thanks
    Last edited by Leith Ross; 01-23-2008 at 05:48 PM.

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