Filename Created with VBA Does Not Display In Save As Dialog Box

censo

Board Regular
Joined
Dec 25, 2015
Messages
161
Office Version
  1. 2013
Platform
  1. Windows
PREFACE
The following code successfully copies a worksheet in a workbook into a completely different workbook using a specific naming convention:

VBA Code:
Sheets("FFIL").Copy
    ActiveWorkbook.SaveAs Filename:=Format(Now(), "mm.dd.yy-hhnn-UPL"), FileFormat:=xlText
    ActiveSheet.Name = "FFIL"

PROBLEM
The issue I have is, the header across the top of Excel of the newly created workbook correctly shows the desired filename (e.g., "07.22.21-1643-UPL") but when I click on the Save As icon, the name of this file does not populate in the Save As dialog box. Instead, the File name: field is just empty (but the correct File Extension is selected, which is (*.txt)

OBJECTIVE
The end goal is for the user to choose what the destination directory will be when saving the document but have the name already populated such that they won't have to type the name in manually. What is missing from the code in order to achieve this functionality?

Thanks in advance.
 

Attachments

  • BlankFileName.JPG
    BlankFileName.JPG
    22.8 KB · Views: 15

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,909
Messages
6,175,314
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top