遗产代码 - 保持活力的最佳做法? [英] Legacy Code - best practices to keep it alive?

查看:60
本文介绍了遗产代码 - 保持活力的最佳做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我不是VBA / Office开发人员,但我的开发团队最近继承了大量关键功能 - 烘焙到电子表格中。通常,这些是直接嵌入电子表格中的VBA宏。还有一些加载项。 I
的问题与它们的依赖关系有关。

I am not a VBA/Office developer, but my development team recently inherited a large number of critical functions - baked into spreadsheets. In general these are VBA macros embedded in spreadsheets directly. There are some add-ins as well. The question I have has to do with their dependencies.

例如,我们有一个依赖于旧控件的加载项--mscomct2.ocx。这件事老了,我的意思是真的老了。我在这些床单上看到这样的东西。我的问题是:

For instance, we have an add-in with a dependency on an old control - mscomct2.ocx. This thing is old, I mean really old. I am seeing stuff like this all over these sheets. My questions are:

1。使用excel的策略是什么,但是"现代化"是什么?依赖?我可以在那里交换控件吗?

1. What are the strategies to keep using excel, but "modernize" the dependencies? Is there a control that I can swap in there?

2。是否有完全不同的策略 - 比如我应该用C#写东西并以某种方式将其挂钩到Excel中?

2. Is there a different strategy altogether - like should I be writing stuff in C# and somehow hooking it into Excel?

3。什么是其他人,在这种情况下(我知道必须有很多)呢?

3. What are other people, in this situation (I know there have to be alot of them) doing?

谢谢,

贾德

推荐答案

这样的activeX控件的主要问题是它们无法与Office64一起使用。但是,即使它们在带有Office32的Win64中工作,每次使用Win32和Win64在用户之间交换文件时都可能会出现更新引用的问题。



MSComCtl最常用的用途.ocx (Microsoft Windows公共控件)是它的DateTime选择器。 
$


DT选择器使用纯VBA进行复制相对简单,并且有各种示例在那里,虽然我没有任何链接。其他控件可能要复杂得多,尽管其中一些也有VBA替代品。免费和
非免费,具体取决于复杂性和整体功能。



The main problem with activeX controls like this is they will not work with Office64. However even though they work in Win64 with Office32 there can be problems updating the reference each time when exchanging files between users with Win32 and Win64.

The most common use for MSComCtl.ocx  (Microsoft Windows Common Controls) is its DateTime picker. 

The DT picker is a relatively simple to replicate with pure VBA and there are various examples out there, though I do not have any links to hand. Other controls can be much more complicated though there are also VBA alternatives for some of them too. Free and non free depending on complexity and overall functionality.



这篇关于遗产代码 - 保持活力的最佳做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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