[Solved] Macro Not Working

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
franklludwig
Posts: 4
Joined: Fri Mar 23, 2018 6:00 pm

[Solved] Macro Not Working

Post by franklludwig »

Hi, I used to have Excel 2003 which is not compatible with Windows 10. I only used it for one Spreadsheet to keep an eye on my finances (which, due to my lack of expertise, took me ages to create). Now I opened it with OpenOfficeCalc, but unfortunately I can't run the macro any more. Could anyone have a look at it and tell me how I can make it work? Thanks.
Attachments
oo.jpg
Last edited by franklludwig on Sat Mar 24, 2018 12:42 pm, edited 1 time in total.
Open Office 4.1.4 on Windows 7
User avatar
Hagar Delest
Moderator
Posts: 33397
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Macro Not Working

Post by Hagar Delest »

Hi and welcome to the forum!

Basically, it would help to post the code instead of a screenshot.
The macro language is different so you've to adapt it with the OpenOffice basic language.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
franklludwig
Posts: 4
Joined: Fri Mar 23, 2018 6:00 pm

Re: Macro Not Working

Post by franklludwig »

The code is:

Code: Select all

Sub update()
'
' update Macro
' Macro recorded 14/04/2007 by Frank L. Ludwig
'
' Keyboard Shortcut: Ctrl+u
'
    Range("J1").Select
    Selection.Copy
    Range("B1").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True
    Range("D3:D19").Select
    Application.CutCopyMode = False
    Selection.ClearContents
    Range("F3:F19").Select
    Selection.ClearContents
End Sub
(It appears the second part of it disappeared which looked dodgy to me, anyway.)
Last edited by robleyd on Sat Mar 24, 2018 9:34 am, edited 1 time in total.
Reason: Added Code tags
Open Office 4.1.4 on Windows 7
User avatar
Zizi64
Volunteer
Posts: 11481
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Macro Not Working

Post by Zizi64 »

Tips:

- try the LibreOffice. It has a littlebit higher compatibility with the foreign file types and the VBA macros.
- use the "Option VBASupport 1" directive at the begin of the code in the Module.
- try to rewrite your macros based on the AOO/LO API using the StarBasic or an another supported programming language.
Last edited by Zizi64 on Sat Mar 24, 2018 4:02 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.
franklludwig
Posts: 4
Joined: Fri Mar 23, 2018 6:00 pm

Re: Macro Not Working

Post by franklludwig »

Prior to posting here I had made several unsuccessful attempts to record a macro in the Open Office file. However, I tried it a few more times since and eventually succeeded.
Open Office 4.1.4 on Windows 7
User avatar
Zizi64
Volunteer
Posts: 11481
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: [Solved] Macro Not Working

Post by Zizi64 »

Recording the macros is not an efficient method, because the macro recorder of the AOO/LO has a limited capability.
You must WRITE your macros based on the API functions of the AOO/LO.

(API: Application Programming Interface)
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.
franklludwig
Posts: 4
Joined: Fri Mar 23, 2018 6:00 pm

Re: [Solved] Macro Not Working

Post by franklludwig »

I only use calculations for one spreadsheet with one simple macro, and I got it to work now. It may not be the most sophisticated solution, but it does the job ;)
Open Office 4.1.4 on Windows 7
Post Reply