CHarris
June 10th, 2000, 08:14 PM
How would I create an Excel spreadsheet and save it to a file within VB?
Thanks,
COrey
Thanks,
COrey
|
Click to See Complete Forum and Search --> : Creating Excel Spreadsheets CHarris June 10th, 2000, 08:14 PM How would I create an Excel spreadsheet and save it to a file within VB? Thanks, COrey Iouri June 11th, 2000, 12:56 PM Dim ApExcel As Object 'To open Excel Set ApExcel = CreateObject("Excel.application") 'Creates an object ApExcel.Visible = True ' So you can see Excel ApExcel.Workbooks.Add 'Adds a new book. ApExcel.cells(1, 1).Formula = "HELLO" 'Add Text to a Cell 'You can use the line above, changing coordenates to go to any 'cell and you can also add Formulas ApExcel.Range("A1:Z1").BORDERS.Color = RGB(0, 0, 0) 'Use it to 'change the borders. ApExcel.Columns("A:AY").EntireColumn.AutoFit 'To adjust the 'column's width. ApExcel.Range("A:Z").Select 'To establish a selection ApExcel.Selection.NumberFormat = "0" 'Adding different formats Iouri Boutchkine iboutchkine@hotmail.com Iouri June 11th, 2000, 12:56 PM To save xlapp.activeworksheet.SaveAs "C:\Whatever" Iouri Boutchkine iboutchkine@hotmail.com codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |