Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Explicit reference?

Status
Not open for further replies.

joel009

Programmer
Jul 7, 2000
272
US
I would like to know of a way to explicitly reference a workbook.worksheet when writing info to it. I am generating a report that takes some time to do and the users keep working in other Excel workbooks whiel it is being created and it sometimes causes errors. Also, if they close the Excel workbook they are working on it sometimes closes Excel altogether and I get a runtime error. Any ideas?


Joel009
 
Simple answer - DON'T LET THEM DO IT - there are certain procedures that need the workbook to have focus or they will error (like select statements). This will happen whether the workbook is referenced explicitly or not
To answer the question:
Workbooks(Workbookname.xls).worksheets(sheetname).range...blah blah blah will explicitly reference Rgds
~Geoff~
 
That's what I thought. I'll disply a message box that warns them and then if it blows up it's they're problem. Or is there a way to lock the screen totally to not allow them to do anything. I have a counter and progress bar that displays % done but they always want to multi task.

Joel
 
Problem is that once the code is running, you'd need different code to trap the change of window action and I'm not sure that's possible - just Knacker the users Rgds
~Geoff~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top