老师,我在控件里写了以下代码,点击该组件时提示如图1的异常,该程序是放在D盘的。
For Each r3 As Row In Tables("转采购合同_转合同").GetCheckedRows
r3("转采购合同") = _UserName
r3("合同打印日期") = Date.Today()
Next
DataTables("转采购合同_转合同").Save()
Dim Book As New XLS.Book(ProjectPath & "Attachments\采购订单合同.xlsx")
Dim fl As String = ProjectPath & "Reports\采购订单合同.xlsx"
Dim str As String = "-1,"
Dim t As Table = e.Form.controls("转合同").Table
For Each r As Row In t.GetCheckedRows
str &= r("_Identify") & ","
Next
Dim f As String = t.Filter
t.Filter = "[_Identify] in (" & str.trim(",") & ")"
book.sheets(0)(8,14).value = "<ALL>"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
t.Filter = f
Dim Proc As New Process '打开工作簿
Proc.File = fl
'Proc.Verb = "Print" '指定动作
Proc.Start()
此主题相关图片如下:1.png
已经存在同名的文件,且处于打开状态,无法保存新的文件。执行前先关闭所有报表文件
老师,我电脑上没有同名的文件打开,他这个有时要点击几次才行。
可能进程还没有关闭,看看任务管理器有没有execl的进程
关闭杀毒软件,加密软件之类的程序
不要放到共享里使用