Call word

zhaozj2021-02-16  51

Private Sub Form_Load () Dim xlApp As Excel.ApplicationDim xlBook As Excel.WorkbookDim xlSheet As Excel.WorksheetSet xlApp = CreateObject ( "Excel.Application") 'Create EXCEL Object Set xlBook = xlApp.Workbooks.Open (App.Path & "/ 1 ") 'Open Excel Workpiece Book Files I Excel Workpiece XLapp.visible = True' Sets Excel Objects (Or Nomo) Set Xlsheet = XLbook.Worksheets (1) Set Activity Worksheet Xlsheet.cells (1, 1) = "Part Name" is assigned to cells (Row, Col) Xlsheet.cells (1, 2) = "Price" 'xlsheet.printout' Print Worksheet 'XLbook.close (true)' Close Workbook 'XLapp.quit' End Excel object set xlapp = Nothing 'Release XLAPP object' xlbook.runautomacros (xlautoopen) 'Run Excel boot macro' xlbook.runautomacros (xlautoClose) 'Run Excel Close Macro

End Sub

转载请注明原文地址:https://www.9cbs.com/read-21804.html

New Post(0)