简体   繁体   English

从 Excel 打开 Access 报告转到“另存为”窗口

[英]Opening Access Report from Excel goes to the 'save as' window

I want to open an Access report from Excel but instead of showing the report it goes to the 'save as' window.我想从 Excel 打开 Access 报告,但不是显示报告,而是转到“另存为”窗口。

I tried acViewDesign, acViewNormal, acViewPreview and without one as well but it all gives me the same thing.我尝试了 acViewDesign、acViewNormal、acViewPreview,但都没有,但它们都给了我同样的东西。

Dim accessApp As Object


Sub DisplayReport()

Dim DocName As String
Dim Path As String

Set accessApp = CreateObject("Access.Application")

Path = "C:\Users\user\Desktop\Database1.accdb"

accessApp.OpenCurrentDatabase Path

accessApp.DoCmd.OpenReport "Sheet1", acViewReport
accessApp.Visible = True

End Sub

Either add reference to the the Access Object Library or use the value 5 in place of acViewReport添加对访问对象库的引用或使用值 5 代替 acViewReport

accessApp.DoCmd.OpenReport "Sheet1", 5

All the constant values are here所有常量值都 在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM