我想从Excel打开Access报告,但是没有直接显示该报告,而是将我引向“另存为”窗口。 。请帮助..
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
要么添加对访问对象库的引用,要么使用值5代替acViewReport
accessApp.DoCmd.OpenReport "Sheet1", 5