Got a credit card? use our Credit Card & Finance Calculators
Thanks to gpadsa,Steffers0,lansdown,Wasron,jfgw, for Donating to support the site
HYPTUSS - How to view macro code in LibreOffice
-
- Posts: 16
- Joined: April 16th, 2021, 11:52 am
- Has thanked: 23 times
HYPTUSS - How to view macro code in LibreOffice
Interested to view the Hyp macros for learning purposes. Closest I can get to the macros is via:
Tools > Macros > Organize Macros > Python...
A "Python Macros" dialog appears. Various Hyp macros are listed (e.g. HypAddShareDlg) but all the dialog buttons (such as "Edit") are greyed-out. I have enabled macros (by setting security to "MEDIUM" as instructed in the User Guide, and also adding the sheet's folder to "Trusted File Locations"), so don't think that's anything to do with it.
HYPTUSS version is "Hyp Top-Up Version-b-u.ods"
LibreOffice version is 7.3.7.2
OS: Ubuntu
User Guide Appendix 1 refers to macro protection in Excel but can't find anything likewise for LibreOffice.
Tools > Macros > Organize Macros > Python...
A "Python Macros" dialog appears. Various Hyp macros are listed (e.g. HypAddShareDlg) but all the dialog buttons (such as "Edit") are greyed-out. I have enabled macros (by setting security to "MEDIUM" as instructed in the User Guide, and also adding the sheet's folder to "Trusted File Locations"), so don't think that's anything to do with it.
HYPTUSS version is "Hyp Top-Up Version-b-u.ods"
LibreOffice version is 7.3.7.2
OS: Ubuntu
User Guide Appendix 1 refers to macro protection in Excel but can't find anything likewise for LibreOffice.
-
- Lemon Quarter
- Posts: 4112
- Joined: November 4th, 2016, 9:24 am
- Has thanked: 3262 times
- Been thanked: 2857 times
Re: HYPTUSS - How to view macro code in LibreOffice
freewheeler wrote:Interested to view the Hyp macros for learning purposes. Closest I can get to the macros is via:
Tools > Macros > Organize Macros > Python...
A "Python Macros" dialog appears. Various Hyp macros are listed (e.g. HypAddShareDlg) but all the dialog buttons (such as "Edit") are greyed-out. I have enabled macros (by setting security to "MEDIUM" as instructed in the User Guide, and also adding the sheet's folder to "Trusted File Locations"), so don't think that's anything to do with it.
HYPTUSS version is "Hyp Top-Up Version-b-u.ods"
LibreOffice version is 7.3.7.2
OS: Ubuntu
User Guide Appendix 1 refers to macro protection in Excel but can't find anything likewise for LibreOffice.
Open HYPTUSS with an archive software such as 7-zip, Winzip or whatever. When you've opened as an archive, the Python scripts are all in a single file Scripts/python/HypTopUp.py
LibreOffice does not have a built-in editor for Python scripts
--kiloran
-
- The full Lemon
- Posts: 12636
- Joined: November 8th, 2016, 7:21 pm
- Been thanked: 2609 times
Re: HYPTUSS - How to view macro code in LibreOffice
...I don't know if this helps but, using LibreOffice 7.3.6.2 (x64) in Windows, when I select 'Organise Macros' I get the message:
"LibreOffice requires a 64-bit Java runtime environment (JRE) to perform this task. Please install a JRE and restart LibreOffice. https://hub.libreoffice.org/InstallJava/?LOlocale=en-GB "
As above, when I select 'Edit Macros', the LibreOffice Macro editor comes up in LibreOffice Basic.
"LibreOffice requires a 64-bit Java runtime environment (JRE) to perform this task. Please install a JRE and restart LibreOffice. https://hub.libreoffice.org/InstallJava/?LOlocale=en-GB "
As above, when I select 'Edit Macros', the LibreOffice Macro editor comes up in LibreOffice Basic.
-
- Posts: 16
- Joined: April 16th, 2021, 11:52 am
- Has thanked: 23 times
Re: HYPTUSS - How to view macro code in LibreOffice
kiloran wrote:Open HYPTUSS with an archive software such as 7-zip, Winzip or whatever. When you've opened as an archive, the Python scripts are all in a single file Scripts/python/HypTopUp.py
That worked!
So, .ods files are a ZIP archive. Good to know!
Thanks
-
- Lemon Quarter
- Posts: 4112
- Joined: November 4th, 2016, 9:24 am
- Has thanked: 3262 times
- Been thanked: 2857 times
Re: HYPTUSS - How to view macro code in LibreOffice
freewheeler wrote:kiloran wrote:Open HYPTUSS with an archive software such as 7-zip, Winzip or whatever. When you've opened as an archive, the Python scripts are all in a single file Scripts/python/HypTopUp.py
That worked!
So, .ods files are a ZIP archive. Good to know!
Thanks
Good. Now treat me gently after you've ploughed through all 8.8k lines of code. I'm just a doddery old self-taught programmer
You'll probably cringe at some of the code
--kiloran
-
- The full Lemon
- Posts: 12636
- Joined: November 8th, 2016, 7:21 pm
- Been thanked: 2609 times
Re: HYPTUSS - How to view macro code in LibreOffice
...kiloran, how did you get to learn about all the relevant functions (or whatever they are!) in LibreOffice etc. Is there some standard reference?
I remember some years ago, with Open Office, I borrowed some of your OO Basic code (for retrieving share prices) and adapted and 'neatified' it to my own requirements. It actually worked, though I didn't really have any proper understanding of OO Basic and its functions and programming.
But I didn't keep up with it. Though it must be lying around somewhere buried on some disc... Might even work with LibreOffice.
I remember some years ago, with Open Office, I borrowed some of your OO Basic code (for retrieving share prices) and adapted and 'neatified' it to my own requirements. It actually worked, though I didn't really have any proper understanding of OO Basic and its functions and programming.
But I didn't keep up with it. Though it must be lying around somewhere buried on some disc... Might even work with LibreOffice.
Last edited by XFool on April 5th, 2023, 4:41 pm, edited 1 time in total.
-
- Posts: 16
- Joined: April 16th, 2021, 11:52 am
- Has thanked: 23 times
Re: HYPTUSS - How to view macro code in LibreOffice
kiloran wrote:Now treat me gently after you've ploughed through all 8.8k lines of code. I'm just a doddery old self-taught programmer
You'll probably cringe at some of the code
Not at all, I'm finding my way around quite easily. The code confirms my suspicion that there's no way to import share data (e.g. yield) from Sharecast without having the share's "Sharecast CSI code". Was hoping there was a way to get it directly using the standard EPIC. Looks like I'll need to replicate (part of) your lookup table - "Company Data Sheet".
I should add, started looking at Sharecast as a source after finding yahoo.finance rather unreliable. And googlefinance doesn't offer yield.
-
- Lemon Quarter
- Posts: 4112
- Joined: November 4th, 2016, 9:24 am
- Has thanked: 3262 times
- Been thanked: 2857 times
Re: HYPTUSS - How to view macro code in LibreOffice
XFool wrote:...kiloran, how did you get to learn about all the relevant functions (or whatever they are!) in LibreOffice etc. Is there some standard reference?
I used some magical incantations and Google, supported by a lot of very naughty words which cannot be repeated here.
The standard Basic reference is:
https://books.google.co.uk/books?id=cHV ... &q&f=false
and I could then work towards python implementations.
Also:
https://forum.openoffice.org/en/forum/v ... 1290cf3370
https://ask.libreoffice.org/c/english/5
https://openoffice3.web.fc2.com/index.html
https://flywire.github.io/lo-p/
https://wiki.documentfoundation.org/Macros
The MRI and APSO extensions for LibreOffice also helped a lot
It's a long hard path! But infinitely better than using Basic within LibreOffice, especially for web scraping. And I could never have done it without Google
--kiloran
-
- Lemon Quarter
- Posts: 4112
- Joined: November 4th, 2016, 9:24 am
- Has thanked: 3262 times
- Been thanked: 2857 times
Re: HYPTUSS - How to view macro code in LibreOffice
freewheeler wrote:The code confirms my suspicion that there's no way to import share data (e.g. yield) from Sharecast without having the share's "Sharecast CSI code". Was hoping there was a way to get it directly using the standard EPIC. Looks like I'll need to replicate (part of) your lookup table - "Company Data Sheet".
HYPTUSS started out using the Sharecast CSI code, but this fell into disuse by Sharecast some years ago, so we evolved to using the Sharecast URL (well, URL suffix). I've never found a way to get the data using the EPIC (same for many other potentially useful websites)
--kiloran
-
- The full Lemon
- Posts: 12636
- Joined: November 8th, 2016, 7:21 pm
- Been thanked: 2609 times
-
- Lemon Quarter
- Posts: 4112
- Joined: November 4th, 2016, 9:24 am
- Has thanked: 3262 times
- Been thanked: 2857 times
Re: HYPTUSS - How to view macro code in LibreOffice
I forgot about this stuff I put on our Financial Software sitekiloran wrote:XFool wrote:...kiloran, how did you get to learn about all the relevant functions (or whatever they are!) in LibreOffice etc. Is there some standard reference?
I used some magical incantations and Google, supported by a lot of very naughty words which cannot be repeated here.
The standard Basic reference is:
https://books.google.co.uk/books?id=cHV ... &q&f=false
and I could then work towards python implementations.
Also:
https://forum.openoffice.org/en/forum/v ... 1290cf3370
https://ask.libreoffice.org/c/english/5
https://openoffice3.web.fc2.com/index.html
https://flywire.github.io/lo-p/
https://wiki.documentfoundation.org/Macros
The MRI and APSO extensions for LibreOffice also helped a lot
It's a long hard path! But infinitely better than using Basic within LibreOffice, especially for web scraping. And I could never have done it without Google
--kiloran
http://lemonfoolfinancialsoftware.weebl ... mming.html
--kiloran
Return to “Financial Software - Discussion”
Who is online
Users browsing this forum: No registered users and 7 guests