vinicsurveying
New member
Hi
I am trying to generate a new file which is created by the user using a UserForm where they select which sheets they want copied to the new file. The new file is saved in the same folder as the original file. The code that works in a normal version of Excel is as follow: -
With ThisWorkbook
_ Fnme = Left(.FullName, InStr(.FullName, “.”) - 1) & __
_ "" & Format(Now, “dd mmm yyyy_hh_mm_ss”) & " SUBMISSION" & “.xlsx”
_ End With_
_ _
_ With Wkbk_
_ _
_ .SaveAs __
_ Filename:=Fnme, __
_ FileFormat:=xlOpenXMLWorkbook_
_ .Close_
The code that worked in a XLS Padlock file before the latest update (and which also got over the problem of the virtual drives) was: -
With ThisWorkbook
_ Set xlspadlock = Application.COMAddIns(“GXLSForm.GXLSFormula”).Object_
_ Dim PathtoFile As String_
_ Filename = xlspadlock.PLEvalVAR(“EXEPath”) & Filename_
_ Fnme = Left(.PathtoFile, InStr(.PathtoFile, “.”) - 1) & __
_ "" & Format(Now, “dd mmm yyyy_hh_mm_ss”) & " SUBMISSION" & “.xlsx”
_ End With_
_ _
_ With Wkbk_
_ _
_ .SaveAs __
_ Filename:=Fnme, __
_ FileFormat:=xlOpenXMLWorkbook_
_ .Close_
However, the first code will only save to the AppData\Roaming folder and the second code no longer works at all.
Can anyone help?
Thanks
I am trying to generate a new file which is created by the user using a UserForm where they select which sheets they want copied to the new file. The new file is saved in the same folder as the original file. The code that works in a normal version of Excel is as follow: -
With ThisWorkbook
_ Fnme = Left(.FullName, InStr(.FullName, “.”) - 1) & __
_ "" & Format(Now, “dd mmm yyyy_hh_mm_ss”) & " SUBMISSION" & “.xlsx”
_ End With_
_ _
_ With Wkbk_
_ _
_ .SaveAs __
_ Filename:=Fnme, __
_ FileFormat:=xlOpenXMLWorkbook_
_ .Close_
The code that worked in a XLS Padlock file before the latest update (and which also got over the problem of the virtual drives) was: -
With ThisWorkbook
_ Set xlspadlock = Application.COMAddIns(“GXLSForm.GXLSFormula”).Object_
_ Dim PathtoFile As String_
_ Filename = xlspadlock.PLEvalVAR(“EXEPath”) & Filename_
_ Fnme = Left(.PathtoFile, InStr(.PathtoFile, “.”) - 1) & __
_ "" & Format(Now, “dd mmm yyyy_hh_mm_ss”) & " SUBMISSION" & “.xlsx”
_ End With_
_ _
_ With Wkbk_
_ _
_ .SaveAs __
_ Filename:=Fnme, __
_ FileFormat:=xlOpenXMLWorkbook_
_ .Close_
However, the first code will only save to the AppData\Roaming folder and the second code no longer works at all.
Can anyone help?
Thanks