CutCopyMode -- What workbook was copied?

G

Greg Lovern

If several workbooks are open, and CutCopyMode is True, is there any
way to tell what workbook was copied? I assume that if you know what
workbook was copied, then you know that whatever is selected in the
activesheet in that workbook is what was copied.

I'm deleting and recreating a custom toolbar on workbook activate/
deactivate, because otherwise the toolbar buttons sometimes point to
the wrong workbook (several workbooks have the same toolbar).

When creating the toolbar, I'm doing a CopyPicture and PasteFace to
get a custom icon on one of the toolbar buttons.

But CopyPicture takes Excel out of CutCopyMode, so I'm checking for
CutCopyMode, and only doing the CopyPicture/PasteFace if Excel is not
in CutCopyMode.

That means that when I copy from one workbook to another, the toolbar
button doesn't get its custom icon. I can set a global variable
indicating whether the custom icon has been pasted, and try to paste
it at other times, such as when clicking a toolbar button, but the
toolbar must be hidden for PasteFace to work, so it might look weird
if I did it just anytime.

If I knew what workbook had been copied, I could copy the selection in
that workbook's activesheet after doing the CopyPicture/PasteFace.

Any suggestions?


Thanks,

Greg
 
G

Greg Lovern

I assume that if you know what
workbook was copied, then you know that whatever is selected in the
activesheet in that workbook is what was copied.

Whoops, that's not true.

Same basic question though -- is there any way to tell what was
copied, if it might have been copied from another workbook?

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top