我的目标是尝试弹出保存或打开已创建文件的选项。
这是我的代码:
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
xlApp = New Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = CType(xlWorkBook.Sheets("sheet1"), Excel.Worksheet)
xlWorkSheet.Cells(1, 1) = "PERIOD"
xlWorkSheet.Cells(1, 2) = "PARTS_NO_FG"
xlWorkSheet.Cells(1, 3) = "QTY_ASSY"
xlWorkSheet.Cells(1, 4) = "COSTING1"
xlWorkSheet.Cells(2, 1) = "201212"
xlWorkSheet.Cells(2, 2) = "01125E6041"
xlWorkSheet.Cells(2, 3) = "5"
xlWorkSheet.Cells(2, 4) = "0"
xlWorkSheet.SaveAs("D:\TemplateAssy.xlsx")
xlWorkBook.Close()
xlApp.Quit()
releaseObject(xlApp)
releaseObject(xlWorkBook)
releaseObject(xlWorkSheet)
那么当我执行这个程序VB.NET时如何弹出谢谢