来自Excel的Open Access报表,无需打印

问题描述 投票:0回答:1

我想从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
excel vba ms-access report
1个回答
0
投票

要么添加对访问对象库的引用,要么使用值5代替acViewReport

accessApp.DoCmd.OpenReport "Sheet1", 5
© www.soinside.com 2019 - 2024. All rights reserved.