How to use a user form without open a worksheet



Is it possible to fill in and save a user form separate from a worksheet without opening the worksheet? For example, worksheet is on sharepoint and the user form is on my own PC.
thanks for your reply.





A user form doesn't exist. Therefore it can't have a location. Therefore it could be anywhere. The short answer to your question is yes and no.

The nearest a user form comes to a physical existence is in its code module which must reside in a workbook. That's the system. A workbook must have at least one worksheet. This sheet can be hidden, leaving only the user form to show. Or it might be stripped of its ribbon, grid removed and fitted with ActiveX controls to look like a user form. In fact, a lot of sense can be made from a technical comparison of a worksheet to a user form. The big difference is that a worksheet can survive without VBA whereas the user form can't. 

Look at the user form as a tool of communication between the user and some worksheet somewhere. It's a custom made UI steering the code behind it. Look upon your shared workbook as a place to store data. In essence, it's a database.

So, the question turns out to be whether or not code in a workbook can write to another workbook. Of course it can. It can open workbooks, read from them, write to them, transfer data between itself and them - even between them - and close them. And it doesn't matter where those workbooks are: on your PC, on an intranet, the Internet or a share. Nor does it matter where the code is: in a user form, behind a worksheet or in a standard code module. Yes. Code doesn't need to be in the same location as the data. Code will be perfectly happy working on your PC to manipulate data in a shared workbook.


Answer the Question

You must create an account to use the forum. Create an Account or Login