Access2Base in Calc - Open a form

Discussions about using 3rd party extension with OpenOffice.org
Post Reply
silvain
Posts: 3
Joined: Thu Dec 31, 2015 6:20 pm

Access2Base in Calc - Open a form

Post by silvain »

I have developped nice and sophisticated macros in Excel VBA to select lists, make lists of e-mails, and create labels for mailing - creating directly a RTF file, making it much easiar to use that any kind of mail merge procedure.
I would like to have them working in calc using the Access2Base extension. On of the persons using such a system cannot operate the macros herself because Microsoft manage to sell a version of Office for Mac without VBA...
Access2base looks promising, and much of my VBA code works pretty well with very little adjustment, but I am stuck on the problem of opening the dialogs (forms).
I tried using the OpenForm (DoCmd.OpenForm) method found on the Access2Base documentation. But this method systematically returns the error message «Erreur d'exécution BASIC. '91' Variable d'objet non définie.» (Basic exectuion error. '91' Object variable not defined).
The forms do open from the macro editor interface, but I do not find a way to open them with a macro assigned to a button.
Any solution for this problem?
LibreOffice 5.0.3.2 - Windows 7 and Linux Ubuntu 14.04
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Access2Base in Calc - Open a form

Post by Villeroy »

Access2Base is about databases. A spreadsheet is not a database.
Please stay with Excel/VBA
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
silvain
Posts: 3
Joined: Thu Dec 31, 2015 6:20 pm

Re: Access2Base in Calc - Open a form

Post by silvain »

Thanks for your answer... But I am disappointed!
Even if Access2Base extension is designed for databases, much of the VBA code does work in my calc spreadsheet.
So I hope that this extension will be... extended in the future so as to work more fully for spreadsheets as well as databases.
LibreOffice 5.0.3.2 - Windows 7 and Linux Ubuntu 14.04
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Access2Base in Calc - Open a form

Post by RoryOF »

An answer might be to query whether the macro is running on Excel or OpenOffice, set a flag to indicate which, then use code appropriate to that operating system. ~If your VBA code is mostly running correctly under Calc, then only a small amount of such customisation will be needed.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
JPL
Volunteer
Posts: 130
Joined: Fri Mar 30, 2012 3:14 pm

Re: Access2Base in Calc - Open a form

Post by JPL »

But I am disappointed!
Even if Access2Base extension is designed for databases, much of the VBA code does work in my calc spreadsheet.
So I hope that this extension will be... extended in the future so as to work more fully for spreadsheets as well as databases.
Thanks for your appreciation of the work done on Access2Base.
However I'm afraid you will remain disappointed. There are no plans to make something like an Excel2Calc extension. :(
There is indeed still a lot to do on the Base part.
I tried using the OpenForm (DoCmd.OpenForm) method found on the Access2Base documentation.
On the Getting Started page of the Access2Base documentation you will find a list of methods that are available even without database connection. Among them the AllDialogs collection. Try using dialogs instead of forms. There is a big chance that it works within Calc. Note however that it has not been thoroughly tested.

Hoping this will help.
JPL
Kubuntu 22.04 / LibO 7.5
Access2Base (LibO).
BaseDocumenter extension (LibO)
ScriptForge (LibO)
Documentation on https://help.libreoffice.org/latest/en- ... bPAR=BASIC
Post Reply