1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Sub test()
Dim objXL4 As New Microsoft.Office.Interop.Excel.Application
Dim wbXL4 As Microsoft.Office.Interop.Excel.Workbook
Dim wsXL4 As Microsoft.Office.Interop.Excel.Worksheet
objXL4.Visible = False
wbXL4 = objXL4.Workbooks.Open("U:\Prog\Mat_and_Hole\Bonus.xls", , True)
wsXL4 = objXL4.ActiveSheet
wsXL4.PageSetup.Orientation = Excel.XlPageOrientation.xlPortrait
'.....
objXL4.Application.DisplayAlerts = False
wbXL4.Close()
objXL4.Quit()
objXL4 = Nothing
wbXL4 = Nothing
wbXL4 = Nothing
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
GC.WaitForPendingFinalizers()
MsgBox("fin")
End sub |