LiteView2 Quickstart — Set Up in 5 Minutes
Works in VBA (Excel, Access, Word, Outlook, PowerPoint, Visio, Project), VB6, VB.NET, C#, C++, Delphi, Python, PowerShell, AutoIt — and any COM host.
LiteView2 embeds a full Chromium browser inside your Access or Excel form — the same way you'd add a text box or PDF viewer. Choose Registered Mode (2 minutes, admin once) or Reg-Free Mode (5 minutes, zero admin).
Watch: Registered Mode setup (15-minute walkthrough)
A walkthrough that uses the boilerplate code below to configure an Access form with LiteView2 and render both local HTML content and a live web page.
Video covers Registered Mode. Reg-Free Mode setup is just below — same boilerplate, no admin command.
Registered Mode vs Reg-Free Mode
Run one administrator command once, then drag the LiteView2 control onto your form like a text box. VBA events fire automatically — no polling, no extra code.
No administrator command needed. Copy the OCX files next to your .accdb and paste one bootstrap module. Browsers are created in VBA code via GetPool().CreateInControl().
| Registered Mode | Reg-Free Mode | |
|---|---|---|
| Setup requirement | Run the installer once per machine. It needs administrator rights once, registers both bitnesses, and adds a normal Settings → Apps entry. | No admin rights needed. Copy two OCX files from liteview2-regfree.zip into the same folder as your .accdb. |
| Form control | Drag LiteView2Ctrl from the Toolbox onto the form at design time — just like a text box. | Add a plain Frame control to the form. The browser attaches to it at runtime via VBA code. |
| VBA bootstrap | None. Set m_lv = Me.LiteView2Ctrl1.Object in Form_Load is all you need in Access. In VB6 write Set m_lv = Me.LiteView2Ctrl1 (without .Object). |
Paste the modLV2Pool module once per database. Call GetPool() from any form. Never touch it again. |
| ⚡ Core difference |
control + events Direct method calls on m_lv. Events fire automatically via COM — m_lv_WebViewReady() runs the moment the browser is ready.
|
pool + browser index Every call goes through the pool with a browser index — GetPool().Navigate m_Idx, url. Browser readiness is signalled via SetReadyCallback — no timer needed.
|
| Readiness signal | m_lv_WebViewReady() fires automatically — same pattern as Form_Load. |
Call pool.SetReadyCallback idx, Me, "OnBrowserReady" — LiteView2 calls your VBA method on the UI thread the moment the browser is ready. |
| Deploy to other PCs | Run the installer once on each target machine (administrator rights once). | Copy .accdb + both OCX files. Zero installation, zero admin rights on any machine. |
| Multiple browsers | Add multiple OCX controls at design time (e.g. LiteView2Ctrl1, LiteView2Ctrl2), each with its own WithEvents variable. |
Multiple browsers created in code at runtime, each addressed by a numeric index. No design-time controls needed. |
Private WithEvents m_lv As LiteView2Lib.LiteView2Ctrl
Private Sub Form_Load()
Set m_lv = Me.LiteView2Ctrl1.Object
End Sub
' Fires automatically when browser is ready
Private Sub m_lv_WebViewReady()
m_lv.SetLocalContentRoot CurrentProject.Path
m_lv.Navigate "https://lv2.example/app.html"
End Sub
' Fires when page finishes loading
Private Sub m_lv_NavigationCompleted( _
ByVal url As String, ByVal success As Boolean)
' safe to push data here
End Sub
Private pool As Object
Private idx As Long
Private Sub Form_Load()
Set pool = GetPool()
idx = pool.CreateInControl( _
"about:blank", Me.Frame1)
pool.SetReadyCallback idx, Me, "OnBrowserReady"
End Sub
' Called by LiteView2 on the UI thread when ready
Public Sub OnBrowserReady()
pool.SetLocalContentRoot idx, CurrentProject.Path
pool.Navigate idx, "https://lv2.example/app.html"
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
If Not pool Is Nothing And idx <> 0 Then
pool.ClearReadyCallback idx
pool.DestroyBrowserSync idx, 2000
idx = 0
End If
End Sub
Registered Mode
- Simpler code — event subs fire automatically, no polling loop
- Drop the control visually at design time — you see exactly where it sits
- IntelliSense works with a type library reference
- Same pattern as any other ActiveX control you've used before
- Requires running the installer once per machine (administrator rights once)
- Deployment to other PCs needs IT involvement or admin access
Reg-Free Mode
- Zero admin rights — works on locked-down corporate PCs
- Self-contained: copy .accdb + OCX files to any PC and it runs
- Multiple browsers per form with independent state
- Browser profiles, InPrivate mode, cross-form browser pooling
- Every call takes a browser index:
GetPool().Method m_Idx, ... - No design-time events — ready notification via
SetReadyCallback, notWithEvents - △ Requires one bootstrap module to be pasted once per database
Choose Registered Mode if…
- You are developing on your own PC where you have admin rights
- All machines that will run this database are machines you control
- You want the simplest possible VBA code
- You prefer placing controls visually at design time
Choose Reg-Free Mode if…
- You are on a corporate PC with no admin rights
- Your users are on machines you cannot install software on
- You want to share the database by copying files — no setup required
- You want browsers created and managed entirely in VBA code at runtime
↓ run liteview2-setup.exe (once, admin required)
LiteView2_x64.ocx registered in Windows
Target PC
↓ run the installer again (once per PC)
Open .accdb normally
YourDatabase.accdb
LiteView2_x64.ocx
LiteView2_x86.ocx
↓ paste to any PC
Open .accdb — works immediately
Select a setup guide
Choose the mode you decided on above and follow the step-by-step instructions.
Registered Mode
"I have admin rights on this machine, or I'm developing on my own PC."
- Drag control from Toolbox onto form
- Native VBA event subs fire automatically
- Simplest possible VBA code
Reg-Free Mode
"I'm on a corporate machine, or I want to deploy without IT involvement."
- Copy OCX files next to .accdb
- Paste one bootstrap module once
- Works on any PC — no installation
Still unsure? Start with Registered Mode. You can always switch later.
Registered Mode — 4 Steps
Step 1 is a one-time install, done once per machine and never again. The whole flow takes about two minutes.
Download and run the installer
Download liteview2-setup.zip,
unzip it, and run liteview2-setup.exe. Approve the Windows prompt when it asks
for administrator rights.
The installer puts LiteView2 in C:\Program Files\LiteView2 and registers
both the 64-bit and 32-bit controls, so the same machine works with
32-bit Office, 64-bit Office and VB6 without you choosing.
regsvr32. The installer does the
registration for you, records what it changed, and gives you a real entry in
Settings → Apps so you can remove it cleanly later. Registering by hand pins the
OCX to whatever folder you ran the command in — move or delete that folder and every
form breaks with “There is no object in this control.” The installer avoids that
by owning a permanent location.
Add LiteView2 to your Toolbox
Open the VBA editor (Alt+F11), right-click the Toolbox → Additional Controls → tick "LiteView2 Control". Click OK. The LiteView2 icon appears in your Toolbox.
Drop it on a form
Open a form in Design View. Drag the LiteView2 control onto it —
exactly like adding a text box or list box. Resize it to fill the
area where you want the browser to appear.
The control will be named LiteView2Ctrl1 by default.
Add the VBA event subs
In the form's module, paste this code (Access):
Private WithEvents m_lv As LiteView2Lib.LiteView2Ctrl
Private Sub Form_Load()
Set m_lv = Me.LiteView2Ctrl1.Object
End Sub
Private Sub m_lv_WebViewReady()
' Map the folder that holds your HTML files, then open a file from it
m_lv.SetLocalContentRoot CurrentProject.Path & "\demos"
m_lv.Navigate "https://lv2.example/hello_browser.html"
End Sub
.Object:
Set m_lv = Me.LiteView2Ctrl1. In VB6, .Object stops with
run-time error 13 (Type mismatch). Use App.Path instead of
CurrentProject.Path. Always call SetLocalContentRoot before you
navigate to a https://lv2.example/ address, otherwise the page cannot be reached.
WithEvents? It means "let me know when something
happens in the browser." WebViewReady is the Sub that runs when the
browser is ready to load a page — the same pattern as Form_Load for a form.
You only add the event subs you actually need.
Reg-Free Mode — 5 Steps
No registration, no admin rights, no IT ticket. The OCX files travel with your database.
Copy the OCX files next to your database
Download liteview2-regfree.zip and copy both OCX files into the same folder as your .accdb file (or your .xlsm workbook, see the Excel steps below):
LiteView2_x64.ocx
LiteView2_x86.ocx
modLV2Pool.bas, the bootstrap module used in step 3 — import it instead of retyping it. Do not rename the OCX files: the bootstrap declares them by these exact names.Add a Frame control to your form
In Design View, add a standard Frame (rectangle) control to your form.
This is where the browser will appear. Set its Special Effect to Flat
and remove its label. Name it Frame1.
Paste the bootstrap module — once per database
In the VBA editor (Alt+F11), insert a new Standard Module. Name it modLV2Pool.
Paste this code. You do this once per database, then forget it exists.
Option Explicit
' ============================================================================
' LiteView2 - registration-free bootstrap (LiteView2 1.0.2.0)
'
' No regsvr32, no installer, no administrator rights. Both OCX files must sit
' in the SAME folder as the .accdb (or .xlsm) that uses them, and travel with
' it wherever it is deployed.
'
' Import this module once per database or workbook: VBA editor (Alt+F11) >
' File > Import File... > modLV2Pool.bas. Then call GetPool() wherever you
' need the browser. The same module works in Access and in Excel.
'
' Keep BOTH OCX files. The #If Win64 branches pick the right one for the host
' Office bitness at runtime, so one folder serves 32-bit and 64-bit machines.
' ============================================================================
' Your licence: put your registered company name and your V1|... activation
' key from the purchase e-mail into these two constants. While LV2_KEY is
' empty, LiteView2 runs its 30-day trial.
Private Const LV2_COMPANY As String = "Your Company"
Private Const LV2_KEY As String = "" ' "V1|..." (leave empty for trial)
#If Win64 Then
Private Declare PtrSafe Function SetDllDirectory Lib "kernel32" _
Alias "SetDllDirectoryW" (ByVal lpPathName As LongPtr) As Long
Private Declare PtrSafe Function LiteView2_ActivateManifest _
Lib "LiteView2_x64.ocx" (ByVal path As LongPtr) As Long
Private Declare PtrSafe Function LiteView2_CreateBrowserPool _
Lib "LiteView2_x64.ocx" () As Object
#Else
Private Declare Function SetDllDirectory Lib "kernel32" _
Alias "SetDllDirectoryW" (ByVal lpPathName As Long) As Long
Private Declare Function LiteView2_ActivateManifest _
Lib "LiteView2_x86.ocx" (ByVal path As Long) As Long
Private Declare Function LiteView2_CreateBrowserPool _
Lib "LiteView2_x86.ocx" () As Object
#End If
Private m_Pool As Object
' The browser pool of this process. The first call loads the control from the
' host file's folder and activates your licence (process-wide, once); every
' later call returns the same pool.
Public Function GetPool() As Object
If m_Pool Is Nothing Then
Dim p As String
p = HostFolder()
SetDllDirectory StrPtr(p)
#If Win64 Then
LiteView2_ActivateManifest StrPtr(p & "\LiteView2_x64.ocx")
#Else
LiteView2_ActivateManifest StrPtr(p & "\LiteView2_x86.ocx")
#End If
Set m_Pool = LiteView2_CreateBrowserPool()
If Len(LV2_KEY) > 0 Then m_Pool.ActivateLicense LV2_COMPANY, LV2_KEY
End If
Set GetPool = m_Pool
End Function
' Folder that holds the host file (and the two OCX files). Works in Access
' (CurrentProject.Path) and in Excel (ThisWorkbook.Path): it is late-bound, so
' the same module compiles in both.
Private Function HostFolder() As String
Dim app As Object
Set app = Application
On Error Resume Next
HostFolder = app.CurrentProject.Path
If Len(HostFolder) = 0 Then
Err.Clear
HostFolder = app.ThisWorkbook.Path
End If
On Error GoTo 0
End Function
GetPool().
After pasting it once, you never open or modify it again. The same module works in Access and Excel.
V1|... activation key into LV2_COMPANY and LV2_KEY
at the top of the module. Leave LV2_KEY empty to run the 30-day trial; nothing
has to be commented out. GetPool() activates the licence once, on its first call.
GetPool() once at program start. Call it when the database or
workbook opens, before any form needs a browser. Do not make the first call inside a button's
event: Access can end with error 0xC015000F there.
Add the form code
In the form's module:
Private pool As Object
Private idx As Long
Private Sub Form_Load()
Set pool = GetPool()
idx = pool.CreateInControl("about:blank", Me.Frame1)
pool.SetReadyCallback idx, Me, "OnBrowserReady"
End Sub
' LiteView2 calls this on the UI thread when the browser is ready
Public Sub OnBrowserReady()
pool.SetLocalContentRoot idx, CurrentProject.Path & "\demos"
pool.Navigate idx, "https://lv2.example/hello_browser.html"
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
If Not pool Is Nothing And idx <> 0 Then
pool.ClearReadyCallback idx
pool.DestroyBrowserSync idx, 2000
idx = 0
End If
End Sub
ClearReadyCallback in Form_Unload?
Always clear the callback before destroying the browser — it prevents a deferred callback from firing against a form that has already closed.
Run the form
Reg-Free Mode in Excel — UserForm
The same two OCX files and the same modLV2Pool module, with a UserForm instead of an Access form.
Copy the files next to your workbook
Copy LiteView2_x64.ocx and LiteView2_x86.ocx from liteview2-regfree.zip into the same folder as your .xlsm. In the VBA editor (Alt+F11), choose File > Import File and import modLV2Pool.bas from the same zip. Do not rename the OCX files.
Add a UserForm with a Frame
Insert a UserForm and name it frmBrowser. Add a Frame to it, remove its caption and name it fraBrowser. Make the Frame as large as you want the browser to be.
Add the UserForm code
Private pool As Object
Private idx As Long
Private Sub UserForm_Initialize()
Set pool = GetPool()
idx = pool.CreateInControl("about:blank", Me.fraBrowser)
pool.SetReadyCallback idx, Me, "OnBrowserReady"
End Sub
' LiteView2 calls this when the browser is ready
Public Sub OnBrowserReady()
pool.SetLocalContentRoot idx, ThisWorkbook.Path & "\demos"
pool.Navigate idx, "https://lv2.example/hello_browser.html"
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
On Error Resume Next
If Not pool Is Nothing And idx <> 0 Then
pool.ClearReadyCallback idx
pool.DestroyBrowserSync idx, 2000
idx = 0
End If
Set pool = Nothing
End Sub
DestroyBrowserSync
when the form closes. Without it the browser process can keep Excel running after you close the workbook.
Show the form
In a standard module, call GetPool once when the workbook opens, then show the form from a macro or a button:
' In ThisWorkbook
Private Sub Workbook_Open()
GetPool ' activate LiteView2 once, at program start
End Sub
' In a standard module
Public Sub ShowBrowser()
frmBrowser.Show
End Sub
ShowBrowser. The browser loads inside your UserForm, with nothing installed or registered.
Put your HTML files in a demos folder next to the workbook.
Your Trial: 30 Days, Full Functionality
Nothing is locked. Every method, every event, every feature is available during the trial — in both Registered Mode and Reg-Free Mode.
During the 30-day trial, LiteView2 shows an "Evaluation version" mark over the browser area. Everything works as in the licensed version — clicks, typing and scrolling pass through the mark — so you can evaluate your application fully. A valid licence key removes the mark at once. The trial length is unchanged.
Check days remaining at any time: Debug.Print m_lv.TrialDaysRemaining
When the trial ends, functions that show or change content are refused and the trial-expired page is shown — no data loss, no database corruption.
To activate, add one line: m_lv.ActivateLicense "Your Name", "YOUR-KEY"
If You See a Confusing Term…
Quick translation table for terms that appear in the docs.
| Term | Plain English |
|---|---|
| Registered Mode | Using LiteView2 after running the installer once on the machine. Drag-and-drop the control onto a form, native VBA events. |
| Reg-Free Mode | Using LiteView2 without any registry commands. Copy OCX files next to .accdb, use GetPool(). |
| WebView2 | The browser engine built into Windows 10/11. Already on your PC — nothing to install. |
| OCX | The LiteView2 control file. Like a DLL but for ActiveX controls. |
| WithEvents | Standard VBA keyword to receive events from a control. Same pattern as Form_Load or Worksheet_Change. |
| WebViewReady | The VBA Sub that fires when the browser is ready to load a page. Your browser's equivalent of Form_Load. |
| NavigationCompleted | Fires after a page finishes loading. Safe to send data to the page here. |
| WebMessageReceived | The Sub that fires when the web page sends data back to your VBA code. |
| GetPool() | The function from the bootstrap module that returns the browser engine in Reg-Free Mode. |
| browserIndex / m_Idx | Which browser slot to use in Reg-Free Mode. If you have one browser, this is always 1. |
| ExecuteScript | Run JavaScript in the page from VBA. |
| SetLocalContentRoot | Tell LiteView2 which folder your HTML files are stored in. |
| https://lv2.example/ | A label for your local HTML files — not a real website. |
| PostWebMessageAsJson | Send data from VBA to the web page as JSON. |
| PushRecordset | Send your query results to the web page in one call. |
| SetReadyCallback | Reg-Free Mode: register a VBA method to be called when a browser is ready. Replaces polling IsReady() in a timer. |
| ClearReadyCallback | Remove the ready callback before destroying a browser in Form_Unload. Prevents a deferred callback from firing after the form closes. |
| IBrowserPool | The interface used in Reg-Free Mode to manage the browser pool. |
| DOM | The page's controls — text boxes, buttons, checkboxes. |