Skip to content

pbPackage Overview

Paul Brower edited this page Jun 26, 2022 · 33 revisions

``

pbPackage Help


ABOUT pbPackage


Object Model Properties


ButtonName

    Get ButtonName() As String

OnErrCancelNav

    Get OnErrCancelNav() As Boolean
    Let OnErrCancelNav(vl As Boolean)

If set to True (Default = False), any navigation to other Worksheets is cancelled if an error occurs.


ErrorSheet

    Get ErrorSheet() As Worksheet

PackageCreated

    Get PackageCreated() As Date

RestoreDefaultState

    Get RestoreDefaultState() As Boolean
    Let RestoreDefaultState(restDefault As Boolean)

RunTimeSeconds

    Get RunTimeSeconds() as Double

IsManaged

    Get IsManaged() As Boolean

ActionType

    Let ActionType(InitAction As InitActionEnum)
    Get ActionType() As InitActionEnum

Set Or Get the type of action that originated the package (iaAutoCode, iaEventResponse, iaButtonClick, iaManual)


BypassRequiredAction

    Get BypassRequiredAction() As Boolean
    Let BypassRequiredAction(byPassReqActn As Boolean)

**NOTE: **Using the 'BypassRequireidAction' is ignored unless both the following are true:

  1. You have set the value of this Private Const in the pbPackage class equal to True:

    Private Const CanRunReqAction As Boolean = True

  2. You code written that returns a boolean (TRUE) if successful that can be called from within the [RunRequiredAction](#RunRequiredAction) Function.


CanHideSource

    Get CanHideSource() As Boolean
    Let CanHideSource(vl As Boolean)

By default, this property is set to True. If True, and part of the pack includes navigating to a different worksheet, the SourceSheet will be hidden after the Target worksheet is activated.


ReturnResult

See Also ExecuteCallByName

    Get ReturnResult() As Boolean
    Let ReturnResult(rtRslt As Boolean)

Code can be executed as part of a package. There are 2 'types' of code a package can execute:

  1. A Public Sub/Function that is defined in a public module.

    1.1 A Return Value is NOT availabe on this type of call

  2. A Public Sub/Function that is defined in an private class and that object is available at the time the package is configured.

    2.1 For example if you have a private class called Invoicer and that is avaialable through a Public Property in a public module called myInvoicer then myInvoicer can be used as the 'call' object, and a Function/Sub in the Invoicer class can bee the call 'method name' 2.2 If the Method being called is a Function, then the result of the call can be stored in this PackageResult property if this (ReturnResult) property is set to True.


PackageResult

    Get PackageResult() As Variant

Target

    Get Target() As Worksheet 

FailedPackage

    Get FailedPackage() As Boolean

TargetSheet

    Get TargetSheet() As Worksheet

IgnoreCleanup

    Get IgnoreCleanup() As Boolean
    Let IgnoreCleanup(ignore As Boolean)

ProtectTargetSheet

    Get ProtectTargetSheet() As Boolean
    Let ProtectTargetSheet(protTarget As Boolean)

Object Model Functions


ExecuteCallByName

    Function ExecuteCallByName() As Boolean

RunRequiredAction

    Function RunRequiredAction

ModifyExecutionState(adjust

    Function ModifyExecutionState(adjust As ModifySuspendState)

UnprotectSheets

    Function UnprotectSheets(ParamArray unprotSheets() As Variant)

OnErrorRedirect

    Function OnErrorRedirect(ErrorSheet As Worksheet)

SetTargetSheet

    Function SetTargetSheet(tarSheet As Worksheet)

SetManager

For my Reddit Friends, You'll have to wait a bit before I provide my Package Manager :-)

    Function SetManager(pkgMgr As Object)

SetSourceSheet

    Function SetSourceSheet(srcSheet As Worksheet)