如何判断电脑是32位还是64位?
如何确定您使用的计算机是 32 位机器还是 64 位机器?
我最好用 vba 来完成这个。
How do you determine if the computer you are on is a 32-bit machine or a 64-bit machine?
I need this done in vba preferrably.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
@Wouter Simon 的答案有点正确,但确实不完整。它缺少一些
Declare
语句以及某种解释。因此,我认为值得在这里展示一个更完整、更有效的版本。
注意事项:
http://msdn.microsoft.com/en -us/library/ms684139%28v=vs.85%29.aspx
@Wouter Simon's answer is sort of on the right track, but really incomplete. It is missing a couple of
Declare
statements as well as some kind of explanation.Therefore I believe it's worth presenting a more complete and working version here.
Caveat:
http://msdn.microsoft.com/en-us/library/ms684139%28v=vs.85%29.aspx
从那里得到的
http://www.msoffice.us/Access/PDF/Extending %20VBA%20with%20APIs.pdf。看来它正在我的身上发挥作用。
http://msdn.microsoft.com/en-我们/library/ms724340(v=vs.85).aspx
got it from
http://www.msoffice.us/Access/PDF/Extending%20VBA%20with%20APIs.pdf. Seems like it is working on mine.
http://msdn.microsoft.com/en-us/library/ms724340(v=vs.85).aspx
要确定正在运行的 Office 是 64 位还是 32 位:
使用 IsWow64Process(Jean-François Corbett 的回答)。
要确定 Windows 是 64 位还是 32 位:
To determine whether the running Office is 64-bit or 32-bit:
Use IsWow64Process (answer from Jean-François Corbett).
To determine whether Windows is 64-bit or 32-bit:
我认为最直接的方法是:
有时检查您的Office是32位还是64位并使用此信息访问注册表中的正确密钥也很有用。所以你可以这样做:
HTH
I think the most straightforward way is:
Sometimes it is also useful to check whether your Office is 32 or 64 and use this information to access the correct key in registry. So you can do:
HTH
条件编译可能非常有用,
WinXX
检测环境但不检测硬件属性,示例如下:Conditional compilation could be very useful,
WinXX
detects environment but not hardware properties, example below :我认为 VBA 可能与正在运行的 Office 版本相关联,并且正在运行的进程类型确实很重要。此代码片段可能有帮助(VB6代码)
I think VBA may be linked to the office version that is running and it really matters what type of process is running. This code snippet may help (VB6 code)