Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I have this piece of code that on click displays a dialog window where we can select a pdf file and once we select the file it saves the file at the specified location. What I want: I want it to be saved by a specific name. Rite now its just saving at the specified location with the original name which I want to change to one of the form fields name. Here is my code for that: Private Sub Browse_Click() Dim varFile As Variant, strDestFolder As String, FName As String srDestFolder = "C:\My Documents\" FName = "LP -" & Me.StuName.Value With Application.FileDialog(msoFileDialogOpen) .AllowMultiSelect = False .Filters.Clear .Filters.Add "Adobe Acrobat", "*.pdf", 1 .Show If .SelectedItems.Count = 0 Then Exit Sub varFile = .SelectedItems(1) End With 'Copy File FileCopy varFile, strDestFolder & _ Mid(varFile, InStrRev(varFile, Application.PathSeparator)) MsgBox ("Your file has been uploaded") End Sub Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Saving file to specific directory | Excel Programming | |||
VBA for saving a file to a specific location | Excel Programming | |||
Saving a file using a specific name in a cell | Excel Worksheet Functions | |||
Saving file to a specific folder | Excel Discussion (Misc queries) | |||
Disabling Saveas and saving file with a specific name only | Excel Programming |