Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default providing a sheet-copy event or copy CustomProperties

I have an add-in which stores sheet-based metadata in the workbook. It does
this by putting the metadata in CustomProperties found in the Worksheet
object. When the sheet is moved to another workbook, my data goes with it.
However, when the sheet is copied, the CustomProperties are not copied. The
easiest fix to my problem is for excel to simply to copy this data when the
user copies the sheet. This is probably how it should work anyway.

I would be happy to do this myself by catching some event. However, there
is no Copy sheet event. The closest thing is Workbook_NewSheet event but
this doesn't discriminate between copies and new worksheets. A second way
you could fix my issue is to provide a new event or generalize the NewSheet
event. This would be more invasive to your UI, but it's reasonable that an
excel programmer would want this event information.

Either of these fixes would make me happy. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default providing a sheet-copy event or copy CustomProperties

I just noticed that the NewSheet event doesn't actually get fired for sheet
copies. Only SheetActivate and SheetDeactivate are fired. This is an even
more limited situation than I depicted. My suggestion is still relevant, but
the potential to mess up existing applications is greater. Probably the best
thing to do would be to create a new Event handling sheet copy, move, and
rename as one event. But like I said the first fix is the easiest.

Thanks, Carlos
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default providing a sheet-copy event or copy CustomProperties

Hi Carlos,

I have an add-in which stores sheet-based metadata in the workbook. It does
this by putting the metadata in CustomProperties found in the Worksheet
object. When the sheet is moved to another workbook, my data goes with it.
However, when the sheet is copied, the CustomProperties are not copied. The
easiest fix to my problem is for excel to simply to copy this data when the
user copies the sheet. This is probably how it should work anyway.


This is a peer-to-peer newsgroup, where the questions are answered by other
Excel users, not Microsoft staff. So it's unlikely that your suggestion will be
heard at Microsoft.

That said, one common way to store metadata in a worksheet is to create
sheet-level, hidden, defined names, using Worksheet.Names.Add

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet Change Event - copy cell to another sheet dhstein Excel Discussion (Misc queries) 2 October 12th 09 06:35 PM
event macros vs copy/paste Dave Excel Worksheet Functions 2 November 17th 08 02:36 AM
Copy Data on click event Ken Broten Excel Discussion (Misc queries) 1 January 25th 08 08:45 PM
How to search column, copy row, and copy to another sheet in same Rockhound Excel Discussion (Misc queries) 1 December 9th 06 04:16 PM
in VBA Sheets("mysheet").Copy Befo=Sheets(1) how do i get a reference to the newly created copy of this sheet? Daniel Excel Worksheet Functions 1 July 6th 05 09:57 PM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"