+ Reply to Thread
Results 1 to 3 of 3

Save As situation

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Save As situation

    Afternoon all,

    I have a file (a *.xltm file) which I have "protected" as follow:

    When the user opens the file as a template file, I have the SaveAs and Save functions disabled.

    The user then has to select a directory in which to save the *.xlsm file, over which my code has control of the name of the file, as well as the file extension.

    If the file is not a template file, the Save and Save As works as usual.

    This all works perfect, the problem comes in that the directory selection window pops up twice, and I can not undrstand why.

    I have attached the template file.

    If someone can please indicate to me where I have gone wrong, it will be greatly appreciated.
    Attached Files Attached Files
    Last edited by Jacques Grobler; 12-22-2010 at 06:47 AM.
    Jacques


  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Save As situation

    Try turning events off before doing the save:

            'Step 5: Now save a copy of the file in the current
                Application.EnableEvents = False
                ThisWorkbook.SaveAs Filename:=file_NewName, _
                                    FileFormat:=52
    '                                CreateBackup:=False
                Application.EnableEvents = True

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Re: Save As situation

    Hi Dom,

    So simple but it works like a charm, thanks.

+ Reply to Thread

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