Skip to content
SumOfficeSumOfficeSumOffice

Types: VBA and macros

Compute Contract type definitions — the project, running, trust, and the list of approved macros. Names: 36.

Definitions of the names from the “TypeScript type” column on the operation pages.

Other dictionary topics: session, workbook, and sheets · cells and ranges · formulas and calculation · formatting · data and sheet objects · pivot tables · charts and graphics · printing and page layout · Power Query · VBA and macros · protection and review · general and utility.

Types on this page — 36
type ContractMacroTrustIntent =
| { action: "inspect" }
| { action: "inspect_signatures" }
| { action: "keep_macros" }
| { action: "remove_macros_from_copy"; destinationUri: string }
| { action: "save_signature_copy"; destinationUri: string }
| { action: "remove_signatures" }
| { action: "cancel" };
interface ContractMacroTrustInventoryCounts {
packageParts: number;
vbaProjects: number;
vbaRelationships: number;
signatureParts: number;
customUiParts: number;
activeXParts: number;
oleParts: number;
formControlParts?: number;
externalLinkParts?: number;
externalRelationships?: number;
}
type ContractMacroTrustProvenance = "package-inventory" | "protected-view-policy" | "trusted-location-policy";
interface ContractMacroTrustResult {
states: ContractMacroTrustState[];
counts: ContractMacroTrustInventoryCounts;
cryptographicSignatureValidated: false;
vbaRuntimeAvailable: false;
packageFormat?: ContractFileFormat;
trustProvenance?: ContractMacroTrustProvenance[];
opaquePreservationVerified?: boolean;
sourceBytesUnchanged: boolean;
copied: boolean;
outputByteCount: number;
removedPartCount: number;
removedRelationshipCount: number;
macroFreeRemainderCount?: number;
sourceMutated?: boolean;
signatureInventory?: OpcSignatureInventory;
reasonCode?: string;
}
type ContractMacroTrustState =
| "macro-present"
| "signature-part-present"
| "unsigned"
| "modified-after-signature-risk"
| "malformed"
| "blocked-by-protected-view"
| "blocked-by-trusted-location"
| "unsupported";
type ContractTrustCenterMacroPolicy = "block_with_notification" | "block_without_notification";
interface VbaBlockerSourceSpan {
line: number;
column: number;
length: number;
offset: number;
}
interface VbaCapabilityBlocker {
kind: VbaCapabilityBlockerKind;
detail: string;
evidence: string;
sourceSpan: VbaBlockerSourceSpan | null;
module: string;
procedure: string | null;
}
type VbaCapabilityBlockerKind =
| "external-automation"
| "event-or-document-module"
| "language-pending"
| "host-member-pending"
| "unparsed"
| "run-declaration-pending"
| "excel-compile-error";
interface VbaEntrypointDescriptor {
entrypoint: string;
module: string;
procedure: string;
kind: VbaMacroKind;
visibility: VbaMacroVisibility;
userRunnable: boolean;
route: VbaExecutionRoute;
nativeClaim: boolean;
nativeLowerable: number;
blockers: VbaCapabilityBlocker[];
}
interface VbaExecutionOutcome {
kind: VbaExecutionOutcomeKind;
stop: string | null;
detail: string;
rolledBack: boolean;
progress?: {
phase: "pending" | "running" | "finished";
steps: number;
instructionBudget: number;
cancellationRequested: boolean;
};
}
type VbaExecutionOutcomeKind =
| "running"
| "completed"
| "refused-by-capability"
| "unknown-entrypoint"
| "unresolved-code-module"
| "runtime-error"
| "runtime-stopped";
interface VbaExecutionPlan {
planId: string;
planHash: string;
entrypoint: string;
route: VbaExecutionRoute | null;
mayRunNatively: boolean;
blockers: VbaCapabilityBlocker[];
instructionBudget: number;
steps: null;
}
type VbaExecutionRoute = "native" | "excel-bridge" | "excel-bridge-legacy" | "preserve-only";
type VbaExecutionSessionId = string;
type VbaMacroKind = "sub" | "function" | "property-get" | "property-let" | "property-set";
type VbaMacroVisibility = "public" | "private" | "friend";
interface VbaModuleCapability {
name: string;
kind: VbaModuleKind;
supportedLines: number;
unsupportedLines: number;
syntaxErrorLines: number;
entrypointCount: number;
}
type VbaModuleKind = "standard" | "document" | "class" | "form" | "unknown";
interface VbaMutationPreview {
cells: VbaMutationPreviewCell[];
structural: VbaStructuralPreview;
structureTouched: boolean;
sessionStateTouched: boolean;
}
interface VbaMutationPreviewCell {
sheet: string;
row: number;
col: number;
beforeDisplayText: string | null;
afterDisplayText: string | null;
beforeFormula: string | null;
afterFormula: string | null;
}
interface VbaProjectBlockerTally {
kind: VbaCapabilityBlockerKind;
macros: number;
}
interface VbaProjectCapabilitySummary {
modules: number;
macros: number;
nativeCandidates: number;
excelBridge: number;
excelBridgeLegacy: number;
preserveOnly: number;
userRunnable: number;
userRunnableNative: number;
nativeCandidateRatio: number;
topBlockers: VbaProjectBlockerTally[];
}
interface VbaProjectInspection {
capabilityContractVersion: number;
sourceLabel: string;
projectName: string | null;
codePage: number;
modules: VbaModuleCapability[];
references: VbaProjectReference[];
entrypoints: VbaEntrypointDescriptor[];
userForms: VbaUserForm[];
summary: VbaProjectCapabilitySummary;
}
interface VbaProjectReference {
key: string;
value: string;
}
interface VbaScheduledMacro {
earliestTimeSerial: number;
procedure: string;
latestTimeSerial?: number;
schedule: boolean;
}
interface VbaStructuralChange {
operation: VbaStructuralChangeOperation;
sheet: string | null;
description: string;
}
type VbaStructuralChangeOperation =
| "sheet-added"
| "sheet-renamed"
| "sheet-deleted"
| "cells-inserted"
| "cells-deleted"
| "name-defined"
| "save-as-staged";
type VbaStructuralPreview =
| { state: "none" }
| { state: "listed"; changes: VbaStructuralChange[] }
| { state: "incomplete"; named: VbaStructuralChange[] };
interface VbaSuppliedAnswer {
kind: string;
prompt?: string;
value: string;
}
interface VbaSystemFacts {
operatingSystem: string;
userLibraryPath: string;
}
interface VbaUserForm {
name: string;
title: string;
fields: VbaUserFormField[];
actions: VbaUserFormAction[];
unsupportedControls: VbaUserFormUnsupportedControl[];
importError: string | null;
}
interface VbaUserFormAction {
id: string;
label: string;
kind: "submit" | "cancel" | "custom";
requiresConfirmation: boolean;
}
interface VbaUserFormField {
id: string;
label: string;
kind: VbaUserFormFieldKind;
required: boolean;
choices: string[];
default: string | null;
group: string | null;
}
type VbaUserFormFieldKind =
| "text"
| "number"
| "date"
| "boolean"
| "choice"
| "multi_choice"
| "range_picker"
| "file_picker";
interface VbaUserFormUnsupportedControl {
name: string;
controlType: string;
}

Documentation assistant

Answers are assembled from the documentation and may be inaccurate — check the sources.