MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Macro Question


Posted by RoB on November 16, 2001 10:41 PM

Hi, its me again.

I have a macro that saves, and closes a worksheet after it has been inactive for 15 minutes. I have come across a problem when users leave this worksheet open minimized, and have another open, the macro will save and close the active workbook (which it is supposed to do with activeworkbook.save and .close in the code of the first workbook). Im trying to find a way around this. Is there a way to specify, instead of activeworkbook.close, the workbook the code is being run from? then it wouldnt effect other worksheets open, only the one running the code?

Thanks


Posted by Juan Pablo on November 16, 2001 11:09 PM

Try changing ActiveWorkbook to ThisWorkbook

Juan Pablo

Posted by RoB on November 16, 2001 11:24 PM

Exactly what i was looking for, Thanks!

Posted by Lewis on November 17, 2001 1:33 AM

Hi

I would be interested in seeing the code for this as it would solve a problem I have

Lewis