May I use a form in an add-in

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an add-in that fetches data from a recordset in a given place in a sheet, and does this fine
I'd also like to have in the same add-in the database connection form, where the user enters the database name, user name & password. If I do import that form in the add-in, how may I call it and refer to fields in it, as long as I can't see any way to declare a form public
 
Bede,

An add-in is just a workbook saved as an add-in. As such, it can have sheets
and forms which can be used as with any other workbook.

You would start in a macro with in the add-in with

Userform1.Show

as is normal.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

BEDE said:
I have an add-in that fetches data from a recordset in a given place in a sheet, and does this fine.
I'd also like to have in the same add-in the database connection form,
where the user enters the database name, user name & password. If I do
import that form in the add-in, how may I call it and refer to fields in it,
as long as I can't see any way to declare a form public?
 
Thanx
I just found the way around it. The add-in definitely has no sheets, only some subs & functions in it are used from another VBA project. So, in order to show the form in the add-in I made a public sub in the add-in project, and, to refer the fields in the form, I made some getXXX public functions and some setXXX public subs
 
Back
Top