ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   May I use a form in an add-in (https://www.excelbanter.com/excel-programming/292669-may-i-use-form-add.html)

BEDE[_3_]

May I use a form in an add-in
 
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


Bob Phillips[_6_]

May I use a form in an add-in
 
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" wrote in message
...
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[_3_]

May I use a form in an add-in
 
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



All times are GMT +1. The time now is 12:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com