|
请问高手,我想打印一个文件
file_path = "C:\Users\Erick\Desktop\1\MODULE.btw" 但是报错
代码是这个
Sub Print_carton()
Dim file_path As String
Dim btApp As BarTender.Application
Dim btFormat As BarTender.Format
file_path = "C:\Users\Erick\Desktop\1\MODULE.btw"
'----------------------------------------------------------------------
'Order bartender print lab as templet
'----------------------------------------------------------------------
Set btApp = CreateObject("bartender.application")
btApp.Visible = False
Set btFormat = btApp.Formats.Open(file_path)
'---------------------------------------------------------------------
' Assignment a value to variable.
'---------------------------------------------------------------------
btFormat.SetNamedSubStringValue "Var1", Cells(2, 1)
btFormat.SetNamedSubStringValue "Var2", Cells(3, 1)
' Implement print
btFormat.PrintOut
btFormat.Close btDoNotSaveChanges
btApp.Quit
End Sub
|
|