Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
12114:demo [2024/04/15 04:05 UTC] – [Download and Save Sample Code] mwolfe | 12114:demo [2024/04/15 05:12 UTC] – [Strongly-Typed Collection Class] mwolfe | ||
---|---|---|---|
Line 6: | Line 6: | ||
- Extract from Zip folder | - Extract from Zip folder | ||
- Open twinBASIC > **Sample 4** | - Open twinBASIC > **Sample 4** | ||
- | - Enter Project Name: '' | + | - Enter Project Name: '' |
- Save as: '' | - Save as: '' | ||
- Navigate to: '' | - Navigate to: '' | ||
- Create folder named: '' | - Create folder named: '' | ||
- Filename: '' | - Filename: '' | ||
+ | |||
+ | ===== Customize the Addin Name and Description ===== | ||
+ | Next, let's customize the friendly name and description of our addin. | ||
+ | - Go to **dllRegistration.twin** > **DllRegisterServer** | ||
+ | - In the " | ||
+ | - In the " | ||
+ | - Save the project | ||
+ | - Build the project | ||
+ | - Launch '' | ||
+ | - Switch to VBA: < | ||
+ | - Dock the add-in window | ||
+ | - Go to " | ||
+ | - Go to " | ||
+ | * Point out the " | ||
+ | - Close " | ||
===== Create the Tool Window Controls ===== | ===== Create the Tool Window Controls ===== | ||
+ | Next, we're going to customize the controls that appear on the tool window. | ||
- Open myToolWindow.tbcontrol | - Open myToolWindow.tbcontrol | ||
- Select all controls and delete them | - Select all controls and delete them | ||
+ | - Click DIAGNOSTICS error to go to myToolWindow.twin and **delete all dead code** | ||
- Select form and set the following properties: | - Select form and set the following properties: | ||
* Height: 1700 | * Height: 1700 | ||
Line 45: | Line 62: | ||
* Top: 1050 | * Top: 1050 | ||
* Width: 2250 | * Width: 2250 | ||
+ | - Create a version label | ||
+ | * Caption: Version {hhmm} | ||
===== Edit the Code in myToolWindow.twin ===== | ===== Edit the Code in myToolWindow.twin ===== | ||
Line 58: | Line 77: | ||
</ | </ | ||
- | ===== Build and Test the Addin on Same Machine | + | ===== Test the Updated |
- | The following instructions assume a machine with 32-bit Office | + | |
+ | - Make sure Access is closed then **Build** the tB project | ||
+ | - Reopen Access and switch to VBA | ||
+ | - Enter sample text '' | ||
+ | |||
+ | ===== Strongly-Typed Collection Class ===== | ||
+ | Now, let's talk about what this add-in will actually, you know, //do//. | ||
+ | |||
+ | The purpose of the add-in is to encapsulate the '' | ||
+ | |||
+ | I put a link to this article in the Resources page for today' | ||
+ | |||
+ | For our purposes, the important thing to know about them is that you CANNOT build them in the VBA editor. | ||
+ | |||
+ | As you can imagine, manually jumping through those hoops is inefficient and error-prone. | ||
- | - Ensure " | ||
- | - **File** > **Build** | ||
- | * Creates and registers this file: '' | ||
- | * As part of registration, | ||
- | * '' | ||
- | * Description: | ||
- | * FriendlyName: | ||
- | * LoadBehavior: | ||
- | * '' | ||
- | * (Default): '' | ||
- | * '' | ||
- | * (Default): '' | ||
- | * '' | ||
- | * (Default): '' | ||
- | * '' | ||
- | * (Default): '' | ||
- | * ThreadingModel: | ||
- | * '' | ||
- | * (Default): '' | ||
- | * DEBUG CONSOLE should show this: | ||
- | * [LINKER] SUCCESS created output file ' | ||
- | * [LINKER] | ||
- | * [REGISTER] type-library registration completed. DllRegisterServer() returned OK | ||
- | - Open Excel or Access | ||
- | - Press [Alt] + [F11] to go to VBA IDE | ||
- | - Tool window will likely be floating; click and drag to dock it somewhere: | ||
- | - Enter '' | ||
===== Build and Test the Addin on a Different Machine and Bitness ===== | ===== Build and Test the Addin on a Different Machine and Bitness ===== |