挣扎着改变活跃的细胞价值 [英] Struggling with changing Active Cell Value

查看:58
本文介绍了挣扎着改变活跃的细胞价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况如下:

我正在研究项目服务器,让我们说其中一项要求是通过桌面或通过项目专业人员访问项目的项目经理项目Web应用程序中的计划Web部件只能执行以下操作

I am working on project server and let's say one of the requirement is Project managers who access the project through project professional pro on desktop or through the schedule web part in project web app can only do the following

1。)它们只能更改%completed列。没有别的东西可以改变

1.) They can only change the % completed column. nothing else can be changed

我确实意识到项目中没有禁用列等等,所以我正在编写MACRO的路径,我的逻辑是

I do realize there is no disabling columns etc in project so, I am going down the path of writing a MACRO and my logic is


  • 假设用户更改了%completed之外的列,然后将活动单元格值更改为旧值

I可以找到新值,因为我正在使用App_ProjectBeforeTaskChange子例程和NewVal我有

I can find the new value because i am using the App_ProjectBeforeTaskChange sub routine and NewVal i have

我可以通过执行ActiveCell.Text找到旧值

I can find the old value by doing ActiveCell.Text

但是如何将活动单元格值设置回来让我们说"你好",我试过这个。在这里如果他们改变了任务名称我想把它设置为hello ..但它永远不会,其他值我能够...

but how do i set the active cell value back to let's say "Hello", i have tried this. here if they change the task name i want to set it to say hello..but it never does, the other values i am able to..

任何帮助???




推荐答案

更改字段在BeforeChange事件期间的值可能会产生奇怪的结果。您可以设置消息并将"取消"设置为"True"以防止值发生变化。旧值仍将在tsk中(在您的示例中为tsk.Name)。 BTW,tsk是
改变的任务,所以你不必担心ActiveCell.Task。

Changing a field value during its BeforeChange event can have strange results. You can put up a message and set Cancel to True to keep the value from changing. The old value will still be in tsk (tsk.Name in your example). BTW, tsk is the task that's being changed so you don't have to worry about ActiveCell.Task.


这篇关于挣扎着改变活跃的细胞价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆