参考:VBA macro to mass update multiple files in same location
继续得到这个错误并且不知道为什么,基本上试图打印出大量文档,但是这就是阻止它的内容。
Option Explicit
Public Function CreateFile(filePath As String, fileName As String) As File
Dim fileObj As File
Set fileObj = New File
fileObj.InitiateProperties filePath:=filePath, fileName:=fileName ' this is where it stops......
Set CreateFile = fileObj
End Function
Sub Initialize(Optional bool As Boolean)
Application.ScreenUpdating = False
Application.DisplayAlerts = False
End Sub
Public Sub Terminate(Optional bool As Boolean)
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
也希望打印出特定的表格,但我可以自己处理。