采用下面的方案将Excel转成PDF并显示到webBrowser:
Dim wbr As WinForm.WebBrowser = Forms(Args(0)).Controls("WebBrowser1")
Dim tbx As WinForm.TextBox = Forms(Args(0)).Controls("TextBox1")
Dim tm As String = ProjectPath & "Attachments\v_2VW BREST CARAVELLE 2014.xls"
tbx.Text = tm
Dim fl As String = ProjectPath & "Reports\v_2VW BREST CARAVELLE 2014.pdf"
Dim App As New MSExcel.Application
try
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(tm)
'创建Excel文件对应的PDF文件
wb.ExportAsFixedFormat(MSExcel.XlFixedFormatType.xlTypePDF, fl, MsExcel.XlFixedFormatQuality.xlQualityStandard, True, True, System.Reflection.Missing.Value, System.Reflection.Missing.Value, False, System.Reflection.Missing.Value)
wbr.Address = fl
app.quit
catch ex As exception
app.quit
End try
老出现:
此主题相关图片如下:捕获错误.jpg
不希望出现此框,有何办法? 谢谢!