Results 1 to 5 of 5

Thread: Naming a new WorkBook

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    Try this....

    Code:
        Dim wbkNew As Workbook
        Workbooks.Add(xlWorksheet).SaveAs Filename:="NewName", FileFormat:=&H34 '33 = XLSX, 34 = XLSM
        Set wbkNew = Workbooks("NewName.xlsm")
        With wbkNew
            .ChangeFileAccess xlReadOnly
            Kill .FullName
        End With
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  2. #2
    Senior Member
    Join Date
    Apr 2011
    Posts
    190
    Rep Power
    15
    Will do - the other one did not like a full compile - thanks
    xl2007 - Windows 7
    xl hates the 255 number

Similar Threads

  1. Replies: 9
    Last Post: 09-09-2011, 02:30 AM
  2. Replies: 0
    Last Post: 09-06-2011, 01:31 AM

Posting Permissions

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