Skip to content

Commit 3afcd3f

Browse files
committed
Update helper to import other helpers
1 parent d1fced2 commit 3afcd3f

File tree

9 files changed

+60
-29
lines changed

9 files changed

+60
-29
lines changed

public/search-helper/VbaHelpers.zip

7.01 KB
Binary file not shown.

public/search-helper/demo-form.gif

1.77 MB
Loading
668 KB
Loading

public/search-helper/demo.gif

-1.35 MB
Binary file not shown.
-477 Bytes
Loading
-27.3 KB
Binary file not shown.
16.7 KB
Loading

src/components/SearchHelperGuide/SearchHelperGuide.tsx

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,41 @@ import React from 'react';
22

33
import DemoImage from '@components/DemoImage';
44
import Slider from '@components/Slider';
5-
import { DocsLinks } from '@consts/const'
5+
import { DocsLinks, WikiLinks } from '@consts/const'
66

7-
const SearchHelperGuideDemo: React.FC = () => (
7+
const SearchHelperGuideDemo1: React.FC = () => (
88
<div>
99
<p>
1010
There is a helper to search / import other
1111
helpers right from Excel <span role="img" aria-label="icon">🤯</span> How do you like it?
1212
</p>
13-
<DemoImage url="./search-helper/demo.gif" width="64%" />
14-
<p>Follow the steps to install it (to do only once)</p>
13+
<p>The <b>1<small>st</small> option</b> is to call dialog popup (user form) from any worksheet:</p>
14+
<DemoImage url="./search-helper/demo-form.gif" width="80%" />
1515
</div>
1616
);
1717

18-
const SearchHelperGuideStep1: React.FC = () => (
19-
<p><a href="./search-helper/VbaHelpers.zip" download>Download zip</a> and exctract the files</p>
20-
);
21-
22-
const SearchHelperGuideStep2: React.FC = () => (
18+
const SearchHelperGuideDemo2: React.FC = () => (
2319
<div>
24-
<p>Import all the exctracted files (<b>.bas</b> and <b>.frm</b>) into VBA project</p>
25-
<p><b>Developer</b><b>Visual Basic</b><b>File</b><b>Import File...</b></p>
26-
<DemoImage url="./search-helper/steps/import-module.png" width="34%" />
20+
<p>
21+
The <b>2<small>nd</small> option</b> is to call import directly
22+
from <a href={DocsLinks.IMMEDIATE_WINDOW} target="_blank" rel="noreferrer">Immediate window</a> (it&apos;s
23+
something like using a <a href={WikiLinks.CLI} target="_blank" rel="noreferrer">CLI</a>):
24+
</p>
25+
<DemoImage url="./search-helper/demo-immediate.gif" width="80%" />
2726
</div>
2827
);
2928

30-
const SearchHelperGuideStep3: React.FC = () => (
29+
const SearchHelperGuideStep1: React.FC = () => (
3130
<div>
32-
<p>Move imported files (2 modules and 1 form) to <b>Personal.xlsb</b> workbook</p>
33-
<DemoImage url="./search-helper/steps/move-module.png" width="34%" />
34-
<p>You may have to <a href={DocsLinks.PERSONAL_XLSB} target="_blank" rel="noreferrer">create it</a> first</p>
35-
<p>Just record a new macro (<b>Developer</b><b>Record Macro</b>) and select <b>Personal Macro Workbook</b></p>
31+
<p>Follow a few simple steps to install (to do only once)</p>
32+
<p>
33+
To run the macro from any Excel file on your computer you have
34+
to <a href={DocsLinks.PERSONAL_XLSB} target="_blank" rel="noreferrer">create Personal Macro Workbook</a>.
35+
<br/>After creation it&apos;s available in any other Excel file. To create it just record any new macro:
36+
</p>
37+
<p><b>Developer</b><b>Record Macro</b> → Store macro in <b>Personal Macro Workbook</b></p>
3638
<DemoImage url="./search-helper/steps/create-personal-xlsb.png" width="64%" />
37-
<p>Then you can find your <b>Personal.xlsb</b> in one of the following places:</p>
39+
<p>Then you can find your <b>PERSONAL.XLSB</b> in one of the following places:</p>
3840
<ul style={{wordWrap: 'break-word'}}>
3941
<li><i>C:\Program Files\Microsoft Office\Office12\XLSTART</i></li>
4042
<li><i>C:\Documents and Settings\Computer\Application Data\Microsoft\Excel\XLSTART</i></li>
@@ -49,32 +51,59 @@ const SearchHelperGuideStep3: React.FC = () => (
4951
</div>
5052
);
5153

54+
const SearchHelperGuideStep2: React.FC = () => (
55+
<div>
56+
<p>
57+
To allow the macro to interact with VBA project objects you have
58+
to <a href={DocsLinks.TRUST_ACCESS_VBOM} target="_blank" rel="noreferrer">enable the appropriate option</a> in
59+
Excel&apos;s Trust Сenter settings
60+
</p>
61+
<DemoImage url="./search-helper/steps/trust-access-vbom.png" width="64%" />
62+
</div>
63+
);
64+
65+
66+
const SearchHelperGuideStep3: React.FC = () => (
67+
<div>
68+
<p>
69+
<a href="./search-helper/VbaHelpers.zip" download>Download zip</a> and exctract the files.
70+
<br/>Import the exctracted files (<b>.bas</b> and <b>.frm</b>) into the VBAProject of <b>PERSONAL.XLSB</b>:
71+
</p>
72+
<p><b>Developer</b><b>Visual Basic</b> → Select <b>PERSONAL.XLSB</b><b>File</b><b>Import File...</b></p>
73+
<DemoImage url="./search-helper/steps/import-module.png" width="34%" />
74+
</div>
75+
);
76+
5277
const SearchHelperGuideStep4: React.FC = () => (
5378
<div>
54-
<p>Set shortcut to quickly call the macro right from Excel worksheet</p>
79+
<p>To quickly call the macro from any Excel worksheet it&apos;s handy to set a shortcut</p>
5580
<p>
56-
<b>Developer</b><b>Macros</b>select the
57-
macro → <b>Options</b> → Set shortcut (e.g. <b>Ctrl + q</b>) → <b>OK</b>
81+
<b>Developer</b><b>Macros</b>Select the
82+
macro <b>HelpersFormOpen</b> <b>Options</b> → Set shortcut (e.g. <b>Ctrl + q</b>) → OK
5883
</p>
5984
<DemoImage url="./search-helper/steps/set-shortcut.png" width="84%" />
6085
</div>
6186
);
6287

6388
const SearchHelperGuideStep5: React.FC = () => (
6489
<div>
65-
<p>Once you done, just close the file <span role="img" aria-label="icon"></span></p>
66-
<p>You will be prompted to save changes in Personal Macro Workbook → click <b>Save</b></p>
90+
<p>
91+
Congrats! <span role="img" aria-label="icon">🥂</span> That&apos;s all
92+
you need to do. Just close the file <span role="img" aria-label="icon"></span>.
93+
</p>
94+
<p>You will be prompted to save changes in <b>Personal Macro Workbook</b> → click <b>Save</b></p>
6795
<DemoImage url="./search-helper/steps/save-personal-xlsb.png" width="34%" />
6896
</div>
6997
);
7098

7199
const SearchHelperGuide: React.FC = () => (
72100
<section className="search-helper">
73101
<Slider items={[
74-
{ title: 'How it works', node: <SearchHelperGuideDemo /> },
75-
{ title: 'Step 1 - download', node: <SearchHelperGuideStep1 /> },
76-
{ title: 'Step 2 - import', node: <SearchHelperGuideStep2 /> },
77-
{ title: 'Step 3 - personal book', node: <SearchHelperGuideStep3 /> },
102+
{ title: 'How it works - form', node: <SearchHelperGuideDemo1 /> },
103+
{ title: 'How it works - immediate', node: <SearchHelperGuideDemo2 /> },
104+
{ title: 'Step 1 - personal book', node: <SearchHelperGuideStep1 /> },
105+
{ title: 'Step 2 - trust access', node: <SearchHelperGuideStep2 /> },
106+
{ title: 'Step 3 - add code', node: <SearchHelperGuideStep3 /> },
78107
{ title: 'Step 4 - set shortcut', node: <SearchHelperGuideStep4 /> },
79108
{ title: 'Step 5 - save', node: <SearchHelperGuideStep5 /> }
80109
]} />

src/consts/const.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ export const AppRoutes: TLinks = {
1010

1111
export const WikiLinks: TLinks = {
1212
VBA: 'https://en.wikipedia.org/wiki/Visual_Basic_for_Applications',
13-
DRY: 'https://en.wikipedia.org/wiki/Don%27t_repeat_yourself'
13+
DRY: 'https://en.wikipedia.org/wiki/Don%27t_repeat_yourself',
14+
CLI: 'https://en.wikipedia.org/wiki/Command-line_interface'
1415
};
1516

1617
export const DocsLinks: TLinks = {
1718
EXCEL_VBA_API: 'https://learn.microsoft.com/en-us/office/vba/api/overview/excel',
1819
PERSONAL_XLSB: 'https://support.microsoft.com/en-us/office/create-and-save-all-your-macros-in-a-single-workbook-66c97ab3-11c2-44db-b021-ae005a9bc790',
19-
IMMEDIATE_WINDOW: 'https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/use-the-immediate-window'
20+
IMMEDIATE_WINDOW: 'https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/use-the-immediate-window',
21+
TRUST_ACCESS_VBOM: 'https://support.microsoft.com/en-gb/topic/programmatic-access-to-office-vba-project-is-denied-960d5265-6592-9400-31bc-b2ddfb94b445#ID0EDBBD'
2022
};
2123

2224
export const ReposLinks: TLinks = {

0 commit comments

Comments
 (0)