一些些的code、一點點的Life,這就是生活。
要列印EXCEL需要寫的程式碼還蠻簡單的
首先要加入EXCEL的參考 讓 VB看得懂EXCEL
專案>加入參考> 擴充功能>然後照下圖這樣選。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Imports Microsoft.Office.Interop Public Class Receipt Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Dim x1 As New Excel.Application x1.Workbooks.Open(My.Computer.FileSystem.SpecialDirectories.Desktop & "\test1.xls") '測試用excel檔 x1.ActiveWorkbook.PrintOutEx() x1.Quit() x1 = Nothing End Sub End Class |
一個不務正業,甚麼科技產品都玩的網路宅宅。 If you want to find me,that's easy! I will always on the Internet. so just find me, follow me. I will show you everything fun.