Save As dialog box with prefilled path, filename and file type

  • Hi,

    I finally gave in and found this forum. I am so close to what I want but just can't get it right. I currently have the following code linked to a button and it works perfectly for saving my macro enabled workbook as a regular workbook in the chosen location.

    HOWEVER, I'd prefer a "save as" dialog box open and then I click save manually, the above code just saves the file. I found the following code that gets the filename correct and opens the save as dialog box but it does NOT include a predefined path and it also opens the save as dialog with Macro Enabled workbook selected:

    So, I need a combination of the 2 above examples. I'd like the macro to choose a cell that prefills the filename (that works in both the above), have a predefined path in the code where the files saves to (that works in the first code but not the second), have a save as dialog box open showing the filename prefilled (that works in the second code but it doesn't choose "Excel WorkbooK" as the file type or have a predefined path). I need the macro enabled workbook to save as a regular workbook, i.e. have "Excel Workbook" chosen by default in the save as dialog box file type but with the dropdown of all file types available (the dropdown of all file types is available in the second example). Once its filled out and ready to save, there is no need for the macros to be enabled anymore and frankly they need to be disabled so the next person who views the workbook doesn't make undesirable changes.

    I hope this makes sense. The first bit of code accomplishes most of what I want, it just needs the save as dialog box vs just saving to the chosen path.

    Thanks in advance for any help!

  • Code Tags Added

    Your post does not comply with our Forum RULES. Use code tags around code.

    Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the </> icon at the top of your post window.

    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

  • Sorry about the code tags being left out.

    So I kept trying and was able to figure it out. This code will take a macro enabled workbook and save it to the specified location, with the specified name as a regular workbook while also disabling the warning box about not saving it as macro enabled.Hope this helps someone else. Not sure if or how to mark this as solved or solution.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!