how to avoid deleting a data column a from pivot table

T

Travassos

Hello

i have an aspx/vbscript with a pivot table in it (OWC 10.0) . I wanto
to restrict users from deleting data columns from it.

how can i do it using vbscript ?

thanks in advance

Miguel T
 
A

Alvin Bruney [MVP]

You'll need to either catch the event or disable the context menu with the
delete. It's not a particularly good idea to impose that type of limitation
on an end-user unless there is a good reason for it - it's the default
behavior of the control.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
https://www.microsoft.com/MSPress/books/10933.aspx
OWC Black Book www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
 
T

Travassos

Thanks Alvin,

i have the context menu allready disabled, and yes, i have a good
reason to do so.

Can u tell me which event should i catch?
 
J

jankrib

I've been experimenting with the same thing.

A quick fix is to use the BeforeKeyDown event and cancel the event if
the delete button is pressed.

You can also use the Query event (or the BeforeQuery), but I haven't
find any way to cancel these unless you reinsert the data columns in
this event.


Hope it helps.

Jan Kristian Bjerke
 
T

Travassos

I've been experimenting with the same thing.

A quick fix is to use the BeforeKeyDown event and cancel the event if
the delete button is pressed.

You can also use the Query event (or the BeforeQuery), but I haven't
find any way to cancel these unless you reinsert the data columns in
this event.

Hope it helps.

Jan Kristian Bjerke

Thanks Jan

I dont know if that event tracks when the column is dragging off with
de mouse.

I'm now using the object_DataChange (reason=3) event and simply re
insert the column that have been deleted. :) But i have to flag this
event to prevent it to fire up every time the program (not the user)
change de pivot table layout:

sub ptable_DataChange(Reason)
if reason =3 and FLAG_ReInsert=0 then
CALL Eixo_VA_REPOR
end if
end sub

I'm posting another question ("Ordering 3 data columns") and i belive
you may have the same problem. Please read it

mt

mt
 

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