- #Xmenu user defined location pdf#
- #Xmenu user defined location series#
- #Xmenu user defined location windows#
InitialFilename – This is where the concatenated path location and filename will be defined.įileFilter – This defines the type of file extension to be filtered throughout the dialog window. Line# 12 – We invoke the “GetSaveAsFilename” method to display the dialog window, where we can actually enter our desired filename and also navigate our desired folder location.Įxplanation for the parameters embedded in the “GetSaveAsFilename” method:Īpplication.GetSaveAsFilename ( InitialFilename, FileFilter ) Line# 10 – We concatenate the values from cell “D3” and “D2” and store this concatenated value into a variable named as “strPathFile” Line# 9 – We define the value of default filename onto cell “D2” and store this value into a variable named as “strFilename” Line# 8 – We define the value of default path location onto cell “D3” and store this value into a variable named as “strPathLocation” 'This is the concatenated value of selected folder location and filename Title:="Select Folder and FileName to save") (InitialFileName:=strPathLocation & strFilename, _įilefilter:="PDF Files (*.pdf), *.pdf", _ StrPathFile = strPathLocation & strFilenameįileAndLocation = Application.GetSaveAsFilename _ Now, let’s take a look at the related VBA macro code.
#Xmenu user defined location series#
It only helps to retrieve and return the filename and folder location, which are to be selected by the user from the dialog window, as a series of string value. Meanwhile, path location can also be changed by navigating on to the folder selection panel from the dialog window.Īs a side note, be aware that the method “GetSaveAsFilename” will not actually perform the action of saving for any file. To change the default value for the filename, the user could enter any other desired filename on the “File name” input field. Whatever are the values of both the defined path location and filename provided in cell “D2” and “D3”, they will become the default values to be displayed on the dialog window.
Please read that article for more on the topic.
#Xmenu user defined location pdf#
Pressing the “ Save PDF Report” button will then show the following dialog box or window, commonly known as the “Save File Dialog”, which is to be driven by a visual basic application method called “ GetSaveAsFilename”. These retrieved user inputs from the dialog window can then be used to manipulate the file automatically for any desired individual purposes.Īs shown in the sample image below, cell “D2” contains the value of default filename and cell “D3” contains the value of the default folder location, in which are to be defined later in the Excel macro file.
A simple VBA macro program script will be able to open or display a dialog window, asking the user to enter both the filename and folder location. One simple applicable scenario could be that, when a user has multiple PDF files to be manually selected and copied to a specific folder location.
#Xmenu user defined location windows#
And this can just be simply done by creating an instance of the Windows explorer and recording both the selected path location and entered filename. This capability or feature can be particularly useful for any file copying or transferring process. Copying or moving an Excel-exported PDF file automatically to a specific folder location or local directory can be very easily achieved if you try to run a customized VBA macro program in Microsoft Excel, which essentially enables the user to freely select any desired file and folder location for output purpose.