LogoLogo
vBase.comvBase App
  • Welcome
    • Welcome to vBase
    • Unique Advantages
    • Core Concepts
      • How vBase Works
      • What is a Stamp?
      • Technical Overview
      • Why Blockchains?
    • Example Use Cases
  • Getting Started
    • Start your Journey
    • Stamping Best Practices
    • Python Quickstart
      • Cloud Notebooks
      • Local Installation
  • Web Tools
    • Stamp an Object
    • Verify an Object
  • Use Case How-Tos
    • Verified Investment Track Records
  • Python SDK
    • Samples
      • Creating a Dataset
      • Adding a Dataset Record
      • Adding a Dataset Record Asynchronously
      • Restoring Dataset Provenance
      • Stamp Interactive Brokers Portfolio
      • Stamp Alpaca Portfolio
    • Windows Setup Guide
    • Package vbase-py
    • Package vbase-py-tools
      • Setup
      • commit_s3_objects
      • verify_s3_objects
  • Other SDKs
    • COM Library Overview
    • Working in Excel
      • Via vBase Workbook
      • Via Excel VBA
    • COM API Reference
    • C#
    • TypeScript
  • Technical Reference
    • Command Line Interface
    • Windows Subsystem for Linux (WSL) Guide
    • GCE S3 Compatible Bucket Setup
    • Smart Contract Addresses
Powered by GitBook
On this page
  • Installation
  • VBA Sample Stamping Code
  • Verification
  1. Other SDKs
  2. Working in Excel

Via Excel VBA

PreviousVia vBase WorkbookNextCOM API Reference

Last updated 1 month ago

The vBase Excel VBA library enables you to generate verifiable data and datasets directly from Excel's VBA environment.

The instructions below explain how to create Stamps and Collections using Excel VBA.

Installation

  1. .

  2. Uninstall any existing version of the library.

  3. Install the new version by running setup.exe.

  4. Open Microsoft Excel.

  5. Ensure the 'Developer' ribbon tab is visible:

    • If it is not, enable it in Excel's options:

      1. Right-click the ribbon and select Customize the Ribbon.

      2. Check the Developer checkbox.

  6. Open the VBA Editor:

    • Go to the Developer tab and click Visual Basic.

  7. Add a reference to the vBase library:

    • In the VBA Editor, navigate to Tools → References.

    • Find and select vBase.

  8. Insert a new module:

    • In the VBA Editor, go to Insert → Module.

  9. Copy and paste the sample VBA code (provided below) into the new module.

VBA Sample Stamping Code

The VBA code below demonstrates how to use the vBase library. Copy and paste it into an Excel VBA module to get started.

Sub BuildDataset()

    On Error GoTo ErrorHandler

    Dim vBaseBuilder As New vBase.vBaseBuilder
    Dim vBaseClient As vBase.vBaseClient
    Dim vBaseDataset As vBase.vBaseDataset
    Dim verificationResult As vBase.VerificationResult
    Dim transactionReceipt As vBase.Web3Receipt

    Dim datasetName As String
    Dim forwarderUrl As String
    Dim apiKey As String
    Dim privateKey As String

    datasetName = "<DATASET NAME>"
    forwarderUrl = "<FORWARDER URL>"
    apiKey = "<API KEY>"
    privateKey = "<PRIVATE KEY>"

    ' Create a client and dataset
    Set vBaseClient = vBaseBuilder.CreateForwarderClient(forwarderUrl, apiKey, privateKey)
    Set vBaseDataset = vBaseBuilder.CreateDataset(vBaseClient, datasetName, vBase.ObjectTypes_String)

    ' Add records to the dataset
    Set transactionReceipt = vBaseDataset.AddRecord("Test Data 1")
    ' Add more records as needed
    Set transactionReceipt = vBaseDataset.AddRecord("Test Data 2")

    ' Display the last transaction details
    MsgBox "Last transaction hash: " & transactionReceipt.transactionHash & vbNewLine & _
           "Last transaction timestamp: " & transactionReceipt.timestamp

    ' Verify the dataset commitments
    Set verificationResult = vBaseDataset.VerifyCommitments()

    MsgBox "Verification passed: " & verificationResult.VerificationPassed

    Exit Sub

ErrorHandler:
    MsgBox "Use [Ctrl+Insert] to copy this message to the clipboard." & vbNewLine & _
           "Error: " & Err.Description, vbCritical

End Sub

Verification

Verification of Stamps and Collections inside the VBA environment is not currently supported. Please use our Python SDK or to verify the Stamps made via VBA.

https://app.vbase.com/verify
Download the vBase Excel Library Setup Files