Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: LibreOffice Calc Macro Question

01 Feb 2020   #1
br4

Windows 7 Ultimate x64
 
 
LibreOffice Calc Macro Question

I have a workbook created in Excel that I've been using for a long time without any problems. In attempting to run a macro in Calc (first time in Calc), I'm getting the following error message:

BASIC runtime error.
'91'
Object variable not set.

It points to line 16 of the code:

8 Sheets("avgs").Select
9 Rows("3:3").Select
10 Selection.Insert Shift:=xlDown
11 Range("A4").Copy
12 Range("A3").Select
13 ActiveSheet.Paste
14 Dim rngC As Range
15 For Each rngC In Range("A3")
16 rngC = DateSerial(Year(rngC), Month(rngC) + 1, Day(rngC))
17 Next

Any ideas how to get this to run in Calc?

Also, is there a way to get the list of the workbook's macros to show immediately, without having to dive into the folders to find them?


My System SpecsSystem Spec
.
01 Feb 2020   #2
Barman58

Windows 10 Pro x64 1909 - 18363.657 XP/Vista/Win7/Win8.1 in VM for testing
 
 

Just from a generic coding basis, (not used Libreoffice other than basic look at it)

Line 16 does show a number of spaces in the formula - 16 rngC»=»DateSerial(Year(rngC),»Month(rngC)»+»1,»Day(rngC))

Try removing those spaces that I have marked »

Some coding languages will ignore extraneous spaces, others will not which could be the case here

It could also be that the syntax for the line 14 Dim rngC As Range is incorrect or must be declared at the start of the code (some coding languages are a little pedantic), but this is not obvious as the variable rngC is used in line 15 without throwing an error
My System SpecsSystem Spec
02 Feb 2020   #3
br4

Windows 7 Ultimate x64
 
 

Thanks for the reply.

I removed the spaces as you noted but that didn't work either. My workbook has two macros, one much simpler than the other. I re-recorded the simpler one and am amazed at the difference in code between Calc's VBA code and Excel's code. I would have thought that, with minor differences, the two sets of VBA codes would be very similar. That doesn't seem to be the case. Looks like I'll have to recreate each macro.

Does anyone know of a converter for Excel VBA to Calc VBA?
My System SpecsSystem Spec
.

02 Feb 2020   #4
Bree

Windows 7 Home Premium x64
 
 

Quote   Quote: Originally Posted by br4 View Post
Does anyone know of a converter for Excel VBA to Calc VBA?

Some suggestions here: excel - How do I make vba code compatible with libre office - Stack Overflow
My System SpecsSystem Spec
03 Feb 2020   #5
br4

Windows 7 Ultimate x64
 
 

Considering how complicated the VBA macro code is in LibreOffice, I've decided to stay with MS Office, at least for now. I'm very much surprised that its coding is not more closely aligned with that of MS Office.

Thanks for your replies.
My System SpecsSystem Spec
03 Feb 2020   #6
Barman58

Windows 10 Pro x64 1909 - 18363.657 XP/Vista/Win7/Win8.1 in VM for testing
 
 

VBA is I believe still copywrite software, so it could be that companies / groups or individuals that are not able to licence VBA for use in their free software, would turn to one of the open source "BASIC" type languages to perform programmed tasks in their office suites
My System SpecsSystem Spec
06 Feb 2020   #7
GoldenDog

Windows 7 Home 32 bit
 
 

The easiest way to fix LibreOffice problems is to switch to OpenOffice
My System SpecsSystem Spec
.
07 Feb 2020   #8
br4

Windows 7 Ultimate x64
 
 

Thanks for the tip. I'll give Open Office a try and see how it compares.
My System SpecsSystem Spec
07 Feb 2020   #9
Bree

Windows 7 Home Premium x64
 
 

Quote   Quote: Originally Posted by br4 View Post
Thanks for the tip. I'll give Open Office a try and see how it compares.



The two are almost identical, in fact LibreOffice is a fork of OpenOffce when it looked like OpenOffice was about to die off. That didn't happen, but to this day OpenOffice is in less active development than LibreOffice, tending to lag behind in both features and support.


Quote:
One of the biggest differences between Apache OpenOffice and LibreOffice is the frequency of releases. LibreOffice is updated much more frequently than Apache OpenOffice, which means you'll receive new features and bug fixes more quickly...

...Although both LibreOffice and Apache OpenOffice can open and edit native Microsoft formats DOCX and XLSX, only LibreOffice is able to save to these formats.
Libreoffice vs OpenOffice | TechRadar
My System SpecsSystem Spec
18 Feb 2020   #10
br4

Windows 7 Ultimate x64
 
 

A follow up...

I tried OpenOffice and was not impressed. I think I'd go back to LibreOffice vs OpenOffice, if I decide to abandon MS Office.

Getting back to macros, one more question if I may: In Excel, when I select the 'view macro' option, the resulting Macro box shows all the macros. In LibreOffice, I have to hunt for them. Is there a way to ensure that all the workbook macros are in the same place and the 'run macro' selection goes to that place?
My System SpecsSystem Spec
Reply

 LibreOffice Calc Macro Question




Thread Tools




Similar help and support threads
Thread Forum
Cannot access System Apps(CMD, Mspaint, Calc, etc) after chkdsk.
Not sure whether this is the right place to post this question. Anyway. The issue is that I am not able to access any windows default tools like cmd, mspaint, calc, etc after windows ran check disk on startup. One weird thing is that I am able to use these tools if I run them through third...
Performance & Maintenance
LibreOffice 4.0 Released
LibreOffice 4.0 has been released. Download: https://www.libreoffice.org/download/4-0-new-features-and-fixes Home: https://www.libreoffice.org Regards, GEWB
News
LibreOffice 3.4.3 PDF Issues
Hi guys, I'm currently evaluating LibreOffice's abilities with PDF's, and I'm liking what Draw can do, so far. But, I am having a problem or two. The first is that it takes ages to open a 270 page PDF, it takes around 5 minutes to do so, whereas Acrobat or Reader in less than 10 seconds. Second,...
Software
LibreOffice 3.3 Release Candidate 1
For those who are using LibreOffice.
Software
Calc ++
Calc ++ A tiny (8 kb) and simple calculator, except you can have up to 480 calculations at the same time. You start off with one calculator row and more rows can be added by pressing . You can have a maximum of 480 rows of calculations.
Free Developer Programs and Projects


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 20:17.
Twitter Facebook