PDA

View Full Version : [SOLVED] Using a closed Workbook file



SailFL
08-21-2005, 10:26 AM
With my Userform, I want to be able to read and write information from a workbook. I don't want the user of the UserForm to see the workbook. Can you do this with a closed workbook and how do you lock it so no one else has access to the workbook? Or is it better and faster to open the workbook but keep it hiden (if you can do that)?

What kind of code do I use to do this. Suggestions / Questions

Thanks

Jacob Hilderbrand
08-21-2005, 10:34 AM
Probably the best way would be to open the workbook, get the text, and close the workbook. You can use Application.ScreenUpdating = False to stop the user from seeing what you are doing.

So you can just open the workbook.


Set Wkb = Workbooks.Open(FileName:=...
MyText = Wkb.Sheets("Sheet1").Range("A1").Text
Wkb.Close SaveChanges:=False

SailFL
08-21-2005, 10:44 AM
I have to think about what you suggested but thanks for the input

Jacob Hilderbrand
08-21-2005, 11:15 AM
Ok, this method would also allow for the other workbook to be password protected so user's could not open it themselves.