DT909
12-09-2017, 07:48 AM
Hi,
I have again an issue with my code :
In my userform there're 2 buttons.
When I click on the first one, it opens an excel file, fills information on it and opens "Save as" dialogue box. Then the user can save the file with a unique ID as name.
Once savings is completed, I want the user come back on the userform wich has to contain all the information kept in it.
Because, then he has to click on the second button, which will put the information on the original excel file which contains the macro.
The problem is that, after "Save as" function, I don't see the userform and when I try to reopen it again, the information is gone.
Thanks in advance for your help.
The current code is following :
Private Sub LinkBtn_Click()
Dim wb As Workbook
Dim ws As Worksheet
Set wb = Workbooks.Open("C:\Users\tuquet\Desktop\EAST\EPC\EPC_Template v2.1.xlsx")
Set ws = wb.Worksheets("Selected Suppliers List")
Sheets("Selected Suppliers List").Range("C4").Value = EPCNum
Sheets("Selected Suppliers List").Range("C5").Value = ProjectText.Value
Sheets("Selected Suppliers List").Range("C6").Value = proFITList.Value
Sheets("Selected Suppliers List").Range("C7").Value = ComboBox2.Value
Sheets("Selected Suppliers List").Range("K4").Value = Date1.Value
Sheets("Selected Suppliers List").Range("K5").Value = TextBox2.Value
Sheets("Selected Suppliers List").Range("K6").Value = TextBox4.Value
Sheets("Selected Suppliers List").Range("K7").Value = ComboBox3.Value
Dim IntialName As String
Dim sFileSaveName As Variant
Dim str As String
IntialName = EPCNum
sFileSaveName = Application.GetSaveAsFilename(InitialFileName:=EPCNum, fileFilter:="Excel Files (*.xlsx), *.xlsx")
If sFileSaveName <> False Then
ActiveWorkbook.SaveAs sFileSaveName
str = EPCNum
Application.Dialogs(xlDialogSaveAs).Show str
End If
End Sub
I have again an issue with my code :
In my userform there're 2 buttons.
When I click on the first one, it opens an excel file, fills information on it and opens "Save as" dialogue box. Then the user can save the file with a unique ID as name.
Once savings is completed, I want the user come back on the userform wich has to contain all the information kept in it.
Because, then he has to click on the second button, which will put the information on the original excel file which contains the macro.
The problem is that, after "Save as" function, I don't see the userform and when I try to reopen it again, the information is gone.
Thanks in advance for your help.
The current code is following :
Private Sub LinkBtn_Click()
Dim wb As Workbook
Dim ws As Worksheet
Set wb = Workbooks.Open("C:\Users\tuquet\Desktop\EAST\EPC\EPC_Template v2.1.xlsx")
Set ws = wb.Worksheets("Selected Suppliers List")
Sheets("Selected Suppliers List").Range("C4").Value = EPCNum
Sheets("Selected Suppliers List").Range("C5").Value = ProjectText.Value
Sheets("Selected Suppliers List").Range("C6").Value = proFITList.Value
Sheets("Selected Suppliers List").Range("C7").Value = ComboBox2.Value
Sheets("Selected Suppliers List").Range("K4").Value = Date1.Value
Sheets("Selected Suppliers List").Range("K5").Value = TextBox2.Value
Sheets("Selected Suppliers List").Range("K6").Value = TextBox4.Value
Sheets("Selected Suppliers List").Range("K7").Value = ComboBox3.Value
Dim IntialName As String
Dim sFileSaveName As Variant
Dim str As String
IntialName = EPCNum
sFileSaveName = Application.GetSaveAsFilename(InitialFileName:=EPCNum, fileFilter:="Excel Files (*.xlsx), *.xlsx")
If sFileSaveName <> False Then
ActiveWorkbook.SaveAs sFileSaveName
str = EPCNum
Application.Dialogs(xlDialogSaveAs).Show str
End If
End Sub