Page 1 of 1

Access2Base in Calc - Open a form

Posted: Thu Dec 31, 2015 6:58 pm
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?

Re: Access2Base in Calc - Open a form

Posted: Thu Dec 31, 2015 8:29 pm
by Villeroy
Access2Base is about databases. A spreadsheet is not a database.
Please stay with Excel/VBA

Re: Access2Base in Calc - Open a form

Posted: Fri Jan 01, 2016 1:19 pm
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.

Re: Access2Base in Calc - Open a form

Posted: Fri Jan 01, 2016 1:29 pm
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.

Re: Access2Base in Calc - Open a form

Posted: Fri Jan 01, 2016 2:41 pm
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