The_Steward
Board Regular
- Joined
- Nov 26, 2020
- Messages
- 63
- Office Version
- 365
- Platform
- Windows
I need to understand how to connect a form control button to a public function. I am attempting to create a button for users to 'save as' an exe file that can only be opened by a specific application.
I am still learning VBA and trying to use a public function for the first time. I have spent some time going through posts and trying to put the pieces together but just still don't understand how to make it work.
Any help or suggestions are very welcome.
I am still learning VBA and trying to use a public function for the first time. I have spent some time going through posts and trying to put the pieces together but just still don't understand how to make it work.
VBA Code:
Public Function SaveSecureWorkbookToFile(Filename As String)
Dim XLSPadlock As Object
On Error GoTo Err
Set XLSPadlock = Application.COMAddIns("GXLS.GXLSPLock").Object
SaveSecureWorkbookToFile = XLSPadlock.SaveWorkbook(Filename)
Exit Function
Err:
SaveSecureWorkbookToFile = ""
End Function
Any help or suggestions are very welcome.