excelvbaisfun
New member
Hi @gdgsupport and All ,
YOUR SOFTWARE IS AWESOME! I do need a bit of help please.
I’m having trouble making a quick copy of a sheet and then saving that file. I used to use secure save files, but this app I don’t actually allow any saving, they always load the ‘Original’ version each time.
Here are my important settings:





This code copies the sheet to a new workbook, then attempts to save that workbook with protections temporarily disabled.
desc=”test”
Fname = Application.GetSaveAsFilename(InitialFileName:=desc & Format(Now, “mmddyyyy.hhmm”) & “.xlsx”, Filefilter:=“Excel Files (*.xlsx), *.xlsx”)
If Fname = “” Or Fname = “False” Then
MsgBox “Cancelled!”, vbOKOnly, “Innova”
s_xls = False 'failed; ds 02/08/17
Exit Function
End If
ws.Copy
Set Destwb = ActiveWorkbook
'Saving the Workbook ds 02/04/19
Dim XLSPadlock As Object
In my tests I have also tried ONLY doing SetOption 2 or ONLY SetOption 1 before and after the save.
I also tried .SaveAs using CreateBackup:=False
Once in a great while it works, but basically it’s just leaving these extension-less files instead of excel files.


Thanks for any advice. We’re launching this product tomorrow and this is the only thing I can’t figure out.
Have a great day!
Dan
YOUR SOFTWARE IS AWESOME! I do need a bit of help please.
I’m having trouble making a quick copy of a sheet and then saving that file. I used to use secure save files, but this app I don’t actually allow any saving, they always load the ‘Original’ version each time.
Here are my important settings:





This code copies the sheet to a new workbook, then attempts to save that workbook with protections temporarily disabled.
desc=”test”
Fname = Application.GetSaveAsFilename(InitialFileName:=desc & Format(Now, “mmddyyyy.hhmm”) & “.xlsx”, Filefilter:=“Excel Files (*.xlsx), *.xlsx”)
If Fname = “” Or Fname = “False” Then
MsgBox “Cancelled!”, vbOKOnly, “Innova”
s_xls = False 'failed; ds 02/08/17
Exit Function
End If
ws.Copy
Set Destwb = ActiveWorkbook
'Saving the Workbook ds 02/04/19
Dim XLSPadlock As Object
Code:
If XLSPadlockAvailable() Then
Stop
Set XLSPadlock = Application.COMAddIns("GXLS.GXLSPLock").Object
XLSPadlock.SetOption Option:="2", value:="0"
XLSPadlock.SetOption Option:="1", value:="1"
.SaveAs Filename:=Fname
.Close 'SaveChanges:=False
XLSPadlock.SetOption Option:="2", value:="1"
XLSPadlock.SetOption Option:="1", value:="0"
Else
.SaveAs Filename:=Fname
.Close SaveChanges:=False
End If
'**********
I also tried .SaveAs using CreateBackup:=False
Once in a great while it works, but basically it’s just leaving these extension-less files instead of excel files.


Thanks for any advice. We’re launching this product tomorrow and this is the only thing I can’t figure out.
Have a great day!
Dan