I have some code that allows the user to select a file from a folder named CSV ("\Desktop\Excalibur QCP21\ExcaliburProPlus\CSV Files")
I want to save as a new workbook to a different folder ("C:\Desktop\Excalibur QCP21\02_ImportToExcalibur")
When I run the code it executes without errors, and the file is saved........but to the wrong folder nl. the csv folder
here is the code that saves the workbook
Sub aSaveToTheNewName()
'Save the new file using the name created in Q2
Dim ThisFile As String
Dim strFileName As String
Dim Usersname As String
Dim myFileName As String
Dim Path As String
'ThisFile = Range("Q2").Value
'ActiveWorkbook.SaveAs FileName:=ThisFile
', FileFormat:=xlNormal
Application.DisplayAlerts = False
Usersname = Environ("USERNAME")
strFileName = "C:\Users\" & Usersname & _
"C:\Desktop\Excalibur QCP21\02_ImportToExcalibur"
myFileName = Range("Q2")
ActiveWorkbook.SaveAs FileName:=Path & myFileName & ".xlsx", FileFormat:=51
ThisFile = Range("Q2").Value
ActiveWorkbook.SaveAs FileName:=ThisFile
I will be grateful for your help
I want to save as a new workbook to a different folder ("C:\Desktop\Excalibur QCP21\02_ImportToExcalibur")
When I run the code it executes without errors, and the file is saved........but to the wrong folder nl. the csv folder
here is the code that saves the workbook
Sub aSaveToTheNewName()
'Save the new file using the name created in Q2
Dim ThisFile As String
Dim strFileName As String
Dim Usersname As String
Dim myFileName As String
Dim Path As String
'ThisFile = Range("Q2").Value
'ActiveWorkbook.SaveAs FileName:=ThisFile
', FileFormat:=xlNormal
Application.DisplayAlerts = False
Usersname = Environ("USERNAME")
strFileName = "C:\Users\" & Usersname & _
"C:\Desktop\Excalibur QCP21\02_ImportToExcalibur"
myFileName = Range("Q2")
ActiveWorkbook.SaveAs FileName:=Path & myFileName & ".xlsx", FileFormat:=51
ThisFile = Range("Q2").Value
ActiveWorkbook.SaveAs FileName:=ThisFile
I will be grateful for your help