简体   繁体   English

在 Excel 中限制 autoshape 移动

[英]Limiting autoshape movement in Excel

This is my first question here, so try not to be harsh.这是我在这里的第一个问题,所以尽量不要苛刻。

I am trying to create an excel sheet, which does the following:我正在尝试创建一个 excel 表,它执行以下操作:

  1. reads information from the database through the custom defined class通过自定义的class从数据库中读取信息
  2. using the read specifications, it creates autoshapes and puts them in first sheet使用读取的规范,它创建自动形状并将它们放在第一张纸中

Is there any way to get information when someone changes the autoshapes (ie, resizes or moves them)?当有人更改自选图形(即调整大小或移动它们)时,有什么方法可以获取信息? I thought about using built in events - but non of them works for me.我考虑过使用内置事件 - 但它们都不适合我。 Can I limit autoshape movement in any other way?我可以以任何其他方式限制 autoshape 运动吗?

This sheet needs to be done in Microsoft Office 2003.此表需要在 Microsoft Office 2003 中完成。

I would be grateful for any help.如果有任何帮助,我将不胜感激。

Best regards, Mike.最好的问候,迈克。

[edit] [编辑]
I think than I have found a partial solution - I will test if it works, and if yes - I will post it here.我想我已经找到了一个部分解决方案——我会测试它是否有效,如果是的话——我会在这里发布。

No there are no events that apply to shapes.不,没有适用于形状的事件。 The best you could do is use the existing events - like SheetChange, SheetSelectionChange, WorkbookBeforeSave etc.您可以做的最好的事情是使用现有的事件 - 如 SheetChange、SheetSelectionChange、WorkbookBeforeSave 等。

Then loop through the Sheet.Shapes collection checking for changes and revert them.然后循环通过 Sheet.Shapes 集合检查更改并恢复它们。 You will have to know the original size and locations.您必须知道原始尺寸和位置。

Have you thought of just locking them and protecting the sheet?您是否想过锁定它们并保护床单?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM