Migrating Excel Macro

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
jb101
Posts: 6
Joined: Mon Jan 21, 2008 1:22 am

Migrating Excel Macro

Post by jb101 »

I am trying to migrate an Excel Macro that works with a ListBox Control. The macro fails on the very first statement which is ListBox.Clear. I have not been able to find any documentation related to this. Can someone give me a pointer.
User avatar
Hagar Delest
Moderator
Posts: 32594
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Migrating Excel Macro

Post by Hagar Delest »

Excel macros are not compatible, language is different. You should search the forum with the "Excel macro" string. Try that one: Can't run a VBA macro from MS Excel file.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31264
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Migrating Excel Macro

Post by Villeroy »

Since version 2.3 Calc supports dynamic validation, which may be an Excel compatible alternative to listboxes. See attachment.
Attachments
dynValidation2.3.ods
New dynamic validation
(16.54 KiB) Downloaded 11814 times
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
User avatar
probe1
Volunteer
Posts: 277
Joined: Mon Oct 08, 2007 1:34 am
Location: Chonburi Thailand

Re: Migrating Excel Macro

Post by probe1 »

For examples on (OOo's) listbox handling one can have a look at Basic library "FormWizard" (delivered with a standard installation), which uses SUBs on common tasks (fill, clear, delete first entry, ...); e.g. EmptyFieldsListboxes()

HTH
Cheers
Winfried

DateTime2 extension: insert date, time or timestamp, formatted to your needs
Post Reply