单独的vba代码和控件 [英] Separate vba code and control

查看:63
本文介绍了单独的vba代码和控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含许多控制按钮的工作簿,它连接到同一工作簿中的许多宏。

工作簿通过邮件发送。

我想在2个工作簿中分隔代码和按钮 - 1个包含控制按钮,另一个包含代码。

我只想发送包含控制按钮的工作簿。

这可能吗?

我试过,但得到了错误。无法找到宏,因为它们位于outlook临时库中。

有没有什么技巧,我可以用它来解决这个问题?

I have a workbook containing a number of control buttons, which is connected to a number of macros in the same workbook.
The workbook is send out by mail.
I want to separate code and buttons in 2 workbooks – 1 containing the control buttons and another containing code.
I only want to send out the workbook containing the control buttons.
Is that possible?
I tried, but get thean error. The macros can’t found because they are in an outlook temp library.
Are there any tricks, I could use to get around this?

推荐答案

不可能,它是一个Excel约束。

控制按钮必须在同一个工作簿中有相关的宏。



所有你能做的就是级联宏。

带有按钮的WorkBook有特殊的宏来处理按钮并在第二个WorkBook中调用真正的宏。

第一个WorkBook中的宏有检查被调用的宏是否可用,否则给出一个好消息。
No it is not possible, it is an Excel constraint.
Control buttons must have their associated macros in same WorkBook.

All you can do is cascading macros.
The WorkBook with buttons have special macros that handle the buttons and call the real macros in second WorkBook.
The macros in first WorkBook have to check if called macro is available and give a nice message otherwise.


不可能。如果工作簿不包含宏,则按下按钮只会导致错误。这就像买一辆车而不给他们发动机一样。
No it is not possible. If the workbook does not contain the macros then pressing the buttons will just cause an error. That's like buying someone a car but not sending them the engine.


这篇关于单独的vba代码和控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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