[Solved] Crash when creating Basic macro

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Robitron
Posts: 105
Joined: Thu Nov 15, 2012 5:27 pm

[Solved] Crash when creating Basic macro

Post by Robitron »

Every time I try to create a new basic macro it crashes Calc. I had 4.1.10 (I think) and just tried to create a new spreadsheet with macros but it crashes every time. I updated to 4.1.12, renamed my user folder and tried again but still 100% crash rate when trying to create a macro.

I know, I know, why am I using basic when python is soooooo much better? Please don't comment or ask that. I have my reasons and would ask you to respect them. Basic is there and it is, for my reasons, what I use but it seems completely broken.

As far as I know though, I can still use my files that have previously created macros but for some reason, I cannot create new ones.
Last edited by MrProgrammer on Sun Mar 26, 2023 5:36 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] with LibreOffice -- MrProgrammer, forum moderator
OpenOffice 4.1.12 on Windows 10

If I had to, I'd put Tabasco on everything!
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Calc crashes when creating basic macro 100% of the time

Post by FJCC »

This is common on my Windows system. Sometimes an update will fix the problem but a subsequent update undoes that. If I run in Safe Mode, I can always edit Basic macros. That suggests some driver is causing the problem but I have not been able to figure out which one. Strangely, I can edit macros in the My Macros container when not in Safe Mode, though even that is very touchy.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Robitron
Posts: 105
Joined: Thu Nov 15, 2012 5:27 pm

Re: Calc crashes when creating basic macro 100% of the time

Post by Robitron »

This is extremely frustrating. I really can't handle all of the calculations in a spreadsheet with the macros. So, without it work, OO.o just isn't going to work. I never happened until recently. I've always sworn by OO.o
OpenOffice 4.1.12 on Windows 10

If I had to, I'd put Tabasco on everything!
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Calc crashes when creating basic macro 100% of the time

Post by John_Ha »

Using AOO Calc 4.1.11 on W10 I can go Tools > Macros > Organise macros > OOBasic > My Macros > Standard > Module 1 > fred ..., and edit and save fred without any problems.

I can add a new macro to Main.

I can use the above dialogue to create a new macro bill which appears under My Macros as bill when I save it.

It therefore looks like it is something on your system causing AOO problems rather than "AOO on its own".

AOO is walking dead and any problem unlikely to be fixed. Your options seem to be

1. Run tests in Safe Mode to identify the application causing AOO the problem and stop using it.

2. Try LO to see if it is better.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Robitron
Posts: 105
Joined: Thu Nov 15, 2012 5:27 pm

Re: Calc crashes when creating basic macro 100% of the time

Post by Robitron »

what do you mean Aoo is "walking dead?" Are they not developing it?

Edit: And yes, I can edit macros in "my macros" but I'm trying to create macros that are document explicit, so the macros are only for a specific document.
OpenOffice 4.1.12 on Windows 10

If I had to, I'd put Tabasco on everything!
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Calc crashes when creating basic macro 100% of the time

Post by John_Ha »

Robitron wrote: Thu May 12, 2022 10:48 pmI'm trying to create macros that are document explicit, so the macros are only for a specific document.
I can do that too so it must be something on your PC.

What happened when you tested by running in Safe Mode?
Robitron wrote: Thu May 12, 2022 10:48 pm what do you mean Aoo is "walking dead?" Are they not developing it?
Correct. Development has virtually ceased and critical bugs are not being fixed. Check the 4.1.12 Release notes and the 4.1.12 bug fixes.

Some may be consoled to know that a missing question mark in a dialogue has been corrected and that an occurrence of openoffice.org has been corrected but I am not one. Many carry the legend Cherry-picked for AOO41X which I think means they can be fixed without affecting the core code.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Calc crashes when creating basic macro 100% of the time

Post by JeJe »

You haven't explained what the steps are that you're taking to create the macro and at which point it crashes?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Robitron
Posts: 105
Joined: Thu Nov 15, 2012 5:27 pm

Re: Calc crashes when creating basic macro 100% of the time

Post by Robitron »

I haven't tried in safe mode yet. I'm not sure how to do that. Also, I wanted to be clear about the above statement. Because if the software is dead, I'll have to find something else that will work for me. Because I'll inevitably run into more problems, so it would be pointless to use a dead program with no chance at fixes.

To create a new macro, I follow these steps:
Tools > Macros > Organize Macros > OpenOffice Basic
DocumentName > New > Module1 > Okay = CRASH

Start Recovery > Enable Macros > Next (after "successfully recovered")
Tools > Macros > Organize Macros > OpenOffice Basic
DocumentName > Standard > Module1 > Main > Edit = CRASH

Rinse & Repeat
OpenOffice 4.1.12 on Windows 10

If I had to, I'd put Tabasco on everything!
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Calc crashes when creating basic macro 100% of the time

Post by JeJe »

I don't get a crash following those steps.

As you can get to MyMacros in the IDE... what happens if you select the document from the toolbar combo there and then right click near the bottom of the IDE to insert a module?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Calc crashes when creating basic macro 100% of the time

Post by Zizi64 »

To create a new macro, I follow these steps:
Tools > Macros > Organize Macros > OpenOffice Basic
DocumentName > New > Module1 > Okay = CRASH
It works for me with various versions of the portable LibreOffice and Apache OpenOffice, and with the permanently installed LibreOffice 6.1.6.

Try the LibreOffice. (At least a portable version of it.) Check if it crashes too, or not. If the LO crashes too, the root of the problem is not located in the Office suite, but is located in the specific PC: in the settings, in the hardware, in the environment (for example: in the Java), etc...
Last edited by Zizi64 on Sat May 14, 2022 5:29 pm, edited 1 time in total.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Calc crashes when creating basic macro 100% of the time

Post by John_Ha »

As you can see the crashes you are getting are not normal and others don't get them.

You now have a question to answer:

Do you want to continue using AOO and stop the crashes?

If the answer is yes follow the advice you have repeatedly been given and see if it crashes when you start the PC in safe mode.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Robitron
Posts: 105
Joined: Thu Nov 15, 2012 5:27 pm

Re: Calc crashes when creating basic macro 100% of the time

Post by Robitron »

Okay thank you all for the information. So, I'm not sure how to get into Safe Mode to run AOO but, if it's dead anyway, I'll try Libre. I didn't know Libre would work on windows. I thought it was for mac only.
OpenOffice 4.1.12 on Windows 10

If I had to, I'd put Tabasco on everything!
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Calc crashes when creating basic macro 100% of the time

Post by RoryOF »

Safe Mode is a Windows mode; it used be reached by pressing F8 key when "Starting Windows" was on-screen, but I cannot say for the modern Win 10 and Win 11.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Robitron
Posts: 105
Joined: Thu Nov 15, 2012 5:27 pm

Re: Calc crashes when creating basic macro 100% of the time

Post by Robitron »

Yeah, I'm not sure either. But again, since they're not continuing with AOO, I'm just downloading Libre. They're both the same, right? Are they at least like enough that I don't have to re-learn the macros?
OpenOffice 4.1.12 on Windows 10

If I had to, I'd put Tabasco on everything!
Robitron
Posts: 105
Joined: Thu Nov 15, 2012 5:27 pm

Re: Calc crashes when creating basic macro 100% of the time

Post by Robitron »

Okay, so I've installed LibreOffice. Macros seem to be running fine. So apparently whatever the app is that's conflicting with Apache isn't going to be an issue.

Libre's interface will be interesting to get used to but fun to learn. Thank you so much for the help.
OpenOffice 4.1.12 on Windows 10

If I had to, I'd put Tabasco on everything!
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Calc crashes when creating basic macro 100% of the time

Post by FJCC »

For the curious, here is how to access Safe Mode on my Windows 10 system. All programs should be closed before doing this.

Click the Windows button → Settings (the gear icon) → Update&Security → Choose Recovery from the items on the left → Advanced Start → Restart now → Troubleshoot → Advanced Options → Startup Settings → Restart → Enable Safe Mode (Option #4)

What could be easier?
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Calc crashes when creating basic macro 100% of the time

Post by Zizi64 »

Libre's interface will be interesting to get used to but fun to learn.
You can install same icon sets to the LibreOffice as the OpenOffice uses.
You can choose one from a few icon sets only in the AOO in the menu Tools - Options - View - User Interface:
Galaxy
High contrast
Industrial
Classic

The LO contains more icon sets by default in the in the menu Tools - Options - View - Icon Style:
Default icon serts of the LO.png
Default icon serts of the LO.png (29.22 KiB) Viewed 5617 times



And you can install much more icon sets from the Extensions page:
Custom icon serts of the LO downloadabla from the Extensions.png
Custom icon serts of the LO downloadabla from the Extensions.png (62.39 KiB) Viewed 5617 times

You can dowload and istall the icon set extensions separatelly from the Extension site:
https://extensions.libreoffice.org/?q=icon+theme
Or directly by clicking on the button in the menu Tools - Options - View - Icon Style:
Icon downloading button.png
Icon downloading button.png (1.76 KiB) Viewed 5615 times


And you can set similar menu stucture as the OpenOffice uses.

(Most of menu items are in same position as in OpenOffice are - except when you want to use the Notebookbar appearance of the LO.)
And yes, there are some new menu items in the LO, because the development of the LO is more active.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
dscotese
Posts: 10
Joined: Tue Apr 21, 2020 5:15 am

Re: Calc crashes when creating basic macro 100% of the time

Post by dscotese »

viewtopic.php?p=524323#p524323 is happening to me too, on Windows 11. I will try LibreOffice.
OpenOffice 4.1.7 on Windows 10
TCLynx
Posts: 31
Joined: Tue Jun 09, 2020 1:20 am

Re: [Solved] Crash when creating Basic macro

Post by TCLynx »

Might need to check that you have a 32 bit java runtime environment installed and selected to be able to use the macros.
TCLynx Open office 4.1.6 Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Crash when creating Basic macro

Post by Villeroy »

TCLynx wrote: Mon Apr 10, 2023 2:48 pm Might need to check that you have a 32 bit java runtime environment installed and selected to be able to use the macros.
Trying LibreOffice, he may notice that everything related to Basic/Python macros works without any Java installed on the system. And the few things that need Java do work with a 64-bit Java runtime.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
mathieums
Posts: 12
Joined: Thu Apr 13, 2023 3:30 pm

Re: [Solved] Crash when creating Basic macro

Post by mathieums »

Hi,

I'm also experiencing crash when trying to edit my macros in Windows 10 and Windows 11 with the latest version of OpenOffice (4.1.14 if my memory is right).

The problem seems to be when the basic macro is bound to the file (calc .ods in my case).

If I try to edit the "default" main basic code there's no crash, but if I select MyFile.ods in the top left drop down menu of the editor window then OpenOffice crash!

I've been using OpenOffice for a long time and I feel like it would be hard to switch to LibreOffice :(

I tried LibreOffice but I have a problem with it. It doesn't seem to handle empty cells/empty streams the same way OpenOffice does.

For example in calc:
A1=""
A2=""
A3=A1+A2

In OpenOffice A3 will return an empty cell, but LibreOffice will return an error (#VALUE).

I've look in the settings if I could somehow change LibreOffice behavior but I couldn't find anything useful.

Now I'll have to change thousands of cells and a lot of macros to make my files reliable in LibreOffice. I would really prefer to keep on using OpenOffice (for the moment at least because tax season :()!

Anyone have an idea for this?

Thank you :D
OpenOffice 4.1.14 on Windows 10 & Windows 11
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Crash when creating Basic macro

Post by JeJe »

@ mathieums Go back to a previous version of OO?

Edit: Both LO and OO are very buggy. LO has many fixes - they also broke some things like setting the paragraph backcolor by macro.
Last edited by JeJe on Thu Apr 13, 2023 4:34 pm, edited 1 time in total.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
mathieums
Posts: 12
Joined: Thu Apr 13, 2023 3:30 pm

Re: [Solved] Crash when creating Basic macro

Post by mathieums »

JeJe wrote: Thu Apr 13, 2023 4:32 pm @ mathieums Go back to a previous version of OO?
I tried 4.1.8 to 4.1.14 one by one. Same problem.

Maybe a Windows update like stated in here, or something with Java??
OpenOffice 4.1.14 on Windows 10 & Windows 11
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Crash when creating Basic macro

Post by JeJe »

I'm on 4.1.11, not having any problems with Win 10 macros in documents particularly - mostly use Writer though.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Bidouille
Volunteer
Posts: 574
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: [Solved] Crash when creating Basic macro

Post by Bidouille »

mathieums wrote: Thu Apr 13, 2023 4:34 pm I tried 4.1.8 to 4.1.14 one by one. Same problem.
If you don't reset the user profile before reinstall previous build, that's will be still occurs.
mathieums
Posts: 12
Joined: Thu Apr 13, 2023 3:30 pm

Re: [Solved] Crash when creating Basic macro

Post by mathieums »

Bidouille wrote: Fri Apr 14, 2023 10:14 am
mathieums wrote: Thu Apr 13, 2023 4:34 pm I tried 4.1.8 to 4.1.14 one by one. Same problem.
If you don't reset the user profile before reinstall previous build, that's will be still occurs.
Ahhhh!! No I haven't reset the profile. I'll try that. Thanks for the tip :super:
OpenOffice 4.1.14 on Windows 10 & Windows 11
mathieums
Posts: 12
Joined: Thu Apr 13, 2023 3:30 pm

Re: [Solved] Crash when creating Basic macro

Post by mathieums »

Ok I tried erasing the user folder in appdata and also the share folder in "program files\OpenOffice4". Uninstalled OpenOffice and reinstalled OpenOffice. I tried 4.1.11 and it doesn't work.

I also tried installing OpenOffice 4.1.11 on a computer it was never installed before and same problem. Editing macros that are saved in any .ods files makes OpenOffice crash :(

Both computers are up to date and have the latest Java which had an update rather recently... :(
OpenOffice 4.1.14 on Windows 10 & Windows 11
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Crash when creating Basic macro

Post by JeJe »

My Java is Version 8 Update 333. Have paused Windows updates though.

Just created an ods for another thread with a simple sub in it and saved it and had no problem. Do you get a crash when you do even just that?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
mathieums
Posts: 12
Joined: Thu Apr 13, 2023 3:30 pm

Re: [Solved] Crash when creating Basic macro

Post by mathieums »

Ok ok. I have Java version 1.8.0_361. So I imagine that it is version 8 update 361..??

I've noticed that one of my macro that open an input box makes OpenOffice crash if I enter a "bigger" value than I normally do. I'll need to take a closer look at my code but I don't think I've put any verification in place. I normally enter an integer smaller than a thousand. If I enter 999 it's ok but when I use a bigger number it crash. 99999 makes OpenOffice crash. (dim Montant as Integer --> entering 99999 in InputBox)

Here's my code (it's in french)

Code: Select all

dim Montant as Integer

' Demande si ajoute Montant à la date DateAjout
Question = "Ajout d'un montant de " & Montant & "$ en date du " & DateAjout & " ??"
Select Case MsgBox (Question, 35, "Ajout d'un montant d'aide personnelle")
	Case 6:
		' YES
		' Rien a changer OK, exit select
	Case 7:
		' NO
		Montant = InputBox("Quel montant?", "Définir le montant d'aide personnelle", Montant)
		DateAjout = InputBox("Quel date?", "Définir la date de reception du montant", DateAjout)
	Case Else
		MsgBox ("Opération annulée", 48, "Annulation")
		exit sub
End Select
I don't think an Integer of 99999 should make anything crash :(
Last edited by mathieums on Sat Apr 15, 2023 12:36 am, edited 1 time in total.
OpenOffice 4.1.14 on Windows 10 & Windows 11
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Crash when creating Basic macro

Post by JeJe »

99999 is bigger than an integer. This gives me an overflow error, not a crash

Code: Select all

dim i as integer
i = 99999
Have you tried leaving it as a variant?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply