vba 如何获得excel弹出日历?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12778567/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get excel popUp calendar?
提问by Alegro
I have Excel 2010 and found confused instructions to get popUp calendar in a cell or in a userForm.
我有 Excel 2010,发现在单元格或用户窗体中获取弹出日历的指令很混乱。
File - Options - Add ins - Active Add-ins: 'Pop-Up Calendar is there
I download this Add-in from this site: http://www.fontstuff.com/vba/vbatut07.htm
Still, on loading a file, I get the message
我从这个站点下载这个插件:http: //www.fontstuff.com/vba/vbatut07.htm
尽管如此,在加载文件时,我收到了消息
Could not load an object because it is not available on this machine.
Alt+f11 - ToolBox - RightClick - Additional Controls - I can't see any Calendar or MonthView Control.
Somewhere I found that Access must be installed, but Access IS installed (office 2010 Pro).
I want the Calendar on a Cell (by click or rightClick) and in a userForm available also.
Alt+f11 - 工具箱 - 右键单击 - 附加控件 - 我看不到任何日历或月视图控件。
在某处我发现必须安装 Access,但安装了 Access(Office 2010 Pro)。
我希望单元格上的日历(通过单击或右键单击)和用户窗体也可用。
回答by Hymansonders
I had the same problem as you and after much research on the internet, I managed to get this matter sorted out. The fact is Calendar or MonthView Control has been removed from MS Excel 2010. You have to download the Control and install it. Below is the download link
我遇到了和你一样的问题,经过在互联网上的大量研究,我设法解决了这个问题。事实是 Calendar 或 MonthView 控件已从 MS Excel 2010 中删除。您必须下载该控件并安装它。下面是下载链接
http://activex.microsoft.com/controls/vb6/MSCOMCT2.CAB
http://activex.microsoft.com/controls/vb6/MSCOMCT2.CAB
- Extract Both Files | the .inf file and the .ocx file
- Install | right-click the .inf file | hit "Install"
- Move .ocx file | Move the .ocx file to "C:\Windows\system32"
- Run CMD | Start Menu -> Search -> "CMD.exe" | right-click the icon | Select "Run as administrator"
- Register Active-X File | Type "regsvr32 c:\windows\system32\MSCOMCT2.ocx"
- Open Excel | Open VB Editor
- Activate Control | Tools->References | Select "Microsoft Windows Common Controls 2-6.0 (SP6)"
- Userform Controls | Select any userform in VB project | Tools->Additional Controls Select "Microsoft Monthview Control 6.0 (SP6)"
- Use 'DatePicker' control for VBA UserForm
- 提取两个文件 | .inf 文件和 .ocx 文件
- 安装 | 右键单击 .inf 文件 | 点击“安装”
- 移动 .ocx 文件 | 将 .ocx 文件移动到“C:\Windows\system32”
- 运行 CMD | 开始菜单 -> 搜索 -> "CMD.exe" | 右击图标 | 选择“以管理员身份运行”
- 注册 Active-X 文件 | 输入“regsvr32 c:\windows\system32\MSCOMCT2.ocx”
- 打开 Excel | 打开 VB 编辑器
- 激活控制 | 工具->参考资料| 选择“Microsoft Windows 通用控件 2-6.0 (SP6)”
- 用户窗体控件 | 选择VB项目中的任意用户窗体| 工具->其他控件选择“Microsoft Monthview Control 6.0 (SP6)”
- 对 VBA 用户窗体使用“DatePicker”控件
Hope you get it right now, if not do let me know.
希望你现在得到它,如果没有让我知道。
回答by tagoma
In the Additional Controls list, search Microsoft Date and Time picker Control 6.0 (SP6)
在附加控件列表中,搜索Microsoft 日期和时间选择器控件 6.0 (SP6)