在VBA中,如何使用工具--> 办公链接 --> 使用 Microsoft Office Excel 进行分析
我正在尝试以不进行排序和分组的方式将查询从 MS Access 导出到 MS Excel。 我注意到只需打开查询并单击即可使用此功能:
工具 --> 办公链接 --> 分析一下 使用 Microsoft Office Excel
但是,我不知道如何使用 VBA 以编程方式获得 MS Access 的此功能。
我打算尝试这样的事情:
DoCmd.OpenQuery "QueryName", acViewNormal, acReadOnly
DoCmd.AnalyseFeatureFunctionHere
或者
DoCmd.OpenQuery "QueryName", acViewNormal, acReadOnly
SysCmd(acAnalyseFeatureFunctionHere)
或者
DoCmd.OpenQuery "QueryName", acViewNormal, acReadOnly
Application.AnalyseFeatureFunctionHere
I am attempting to export a query from MS Access into MS Excel in a way that does not carry over the Sorting and Grouping. I have noticed this functionality is simply available by opening a query and clicking:
Tools --> Office Links --> Analyze it
with Microsoft Office Excel
However, I don't know how to get to this feature of MS Access programmatically using VBA.
I was going to try something like this:
DoCmd.OpenQuery "QueryName", acViewNormal, acReadOnly
DoCmd.AnalyseFeatureFunctionHere
or
DoCmd.OpenQuery "QueryName", acViewNormal, acReadOnly
SysCmd(acAnalyseFeatureFunctionHere)
or
DoCmd.OpenQuery "QueryName", acViewNormal, acReadOnly
Application.AnalyseFeatureFunctionHere
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
可以使用“运行命令”来运行菜单命令,例如可以使用“输出到 Excel”:
但是,更常见的是使用“OutputTo”或“TransferSpreadsheet”。
It is possible to run menu commands with Run Command, for example to Output to Excel you could use:
However, it would be more usual to use OutputTo or TransferSpreadsheet.
CommandBars("菜单栏").Controls("工具").Controls("Office 链接").Controls("使用 Microsoft Office Excel 分析").accDoDefaultAction
CommandBars("Menu Bar").Controls("Tools").Controls("Office Links").Controls("Analyze It With Microsoft Office Excel").accDoDefaultAction
在最坏的情况下,您可以使用 SendKeys 发送适当的按键...但这可能并不理想,您将无法(轻松)知道操作何时完成。
At worst you can use SendKeys to send the appropriate key presses... that might not be ideal though, you won't be able to (easily) tell when the operation is complete.