> For the complete documentation index, see [llms.txt](https://docs.soraco.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.soraco.co/docs/faq/how-to-create-a-qlmlicense-object-in-vb6-or-vba.md).

# Using the underlying QlmLicense object in VB6 or VBA

In VB6 or VBA, you typically use the LicenseValidator class generated by the Protect Your Application wizard.

In some cases, you may need to access the underlying QlmLicense object since the LicenseValidator class does not expose all the methods of the QlmLicense class.

You can access the underlying QlmLicense object by calling the LicenseObject() method of the LicenseValidator class.

**Example:**

{% code overflow="wrap" %}

```vba
Dim license As Object
Set license = lv.LicenseObject ()

Dim userData as String
Dim response as String
userData = license.GetUserData("", activationKey, response)
```

{% endcode %}

If you need to create an uninitialized QlmLicense object, you can call the GetQlmLicense() method of the LicenseValidator class.&#x20;

**Example:**

{% code overflow="wrap" %}

```vba
Dim license As QlmLicense
Set license = lv.GetQlmLicense
license.DefineProduct (...)
```

{% endcode %}

Example on how to deactivate a license in VBA

{% code overflow="wrap" %}

```vba
Private Sub DeactivateLicense()
    Dim response As String
    
    Dim computerID As String
    ' Replace this line with the identifer you are using for license binding
    computerID = lv.fOSMachineName
    
    lv.LicenseObject.ReleaseLicense "", lv.ActivationKey, computerID, response
    Dim releaseLicenseInfo As Object
    Set releaseLicenseInfo = lv.GetLicenseInfo
            
    Dim message As String
    
    If lv.LicenseObject.ParseResults(response, releaseLicenseInfo, message) = True Then
        ' Success
        MsgBox message, vbOK
    Else
        ' Failed
        MsgBox message, vbCritical
    End If
End Sub
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.soraco.co/docs/faq/how-to-create-a-qlmlicense-object-in-vb6-or-vba.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
