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