cStartUp Properties Reference
LastError
Gets error message from the last operation.
vb
Public LastError As StringDescription
When Toggle method returns False, detailed error description can be obtained via this property.
Examples
vb
Private Sub MenuStartUp_Click()
If VBMAN.StartUp.Toggle("my-app", App) Then
VBMAN.Toast.Show "Setting successful"
Else
' Get and show error message
Dim ErrorMsg As String
ErrorMsg = VBMAN.StartUp.LastError
MsgBox "Setting failed: " & ErrorMsg, vbCritical, "Error"
End If
End SubCommon Errors
| Error Scenario | Possible Error Message |
|---|---|
| Registry operation failed | Insufficient permissions or registry locked |
| Invalid path | Specified program path does not exist |
Internal Constants
Constants used internally by component (no need to use directly):
vb
Const K As String = "HKCU\Software\Microsoft\Windows\CurrentVersion\Run"This is the Windows system current user's startup item registry location.