How can I use Cells object instead of Range in VBA Compiler?
Never mind, I found it. It works. This is my first compiled sub, hope that someone may find it helpful.
Sub Test1(Param1)
Dim ws As Worksheets
Set ws = Application.Worksheets(“TEST”)
ws.Cells(2,1).Value=1.1223566
End Sub
I replace this in the VBE
’ This function lets you call VBA macros compiled with XLS Padlock
Public Function CallXLSPadlockVBA(ID As String, Param1)
Dim XLSPadlock As Object
Set XLSPadlock = Application.COMAddIns(“GXLSForm.GXLSFormula”).Object
CallXLSPadlockVBA = XLSPadlock.PLEvalVBA(ID, Param1)
Set XLSPadlock = Nothing
End Function
Sub Test1()
Dim Res As Variant
Res = CallXLSPadlockVBA(“Test1”, “”) ’ Replace MyProtectedSub with the name of the protected VBA function you want to call and “” with optional parameter to pass to your protected code
End Sub