Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This code shows how to take data from a VB databas...
Author:
Zack Nealson
E-mail:
Click to e-mail author
Submitted:
5/14/2000
Version:
VB6
Compatibility:
VB6
Category:
Databases
Views:
28063
This code shows how to take data from a VB database application and place it into an Excel spreadsheet.
Declarations:
'none
Code:
Private Sub Excel_Spreadsheet(rst As Recordset) 'Declare all Excel objects Dim xlApp As Excel.Application Dim xlWB As Excel.Workbook Dim xlWS As Excel.Worksheet Set xlApp = New Excel.Application Set XLWB = xlApp.Workbooks.Add Set xlWS = xlWB.Worksheets.Add 'Fill cells using recordset xlWS.Cells(1,1).Value = rst("Field1") xlWS.Cells(2,1).Value = rst("Field2") ' save spreadsheet xlWS.SaveAS "mysheet.xls" xlApp.Quit ' Free memory Set xlWS = Nothing Set xlWB = Nothing Set xlApp = Nothing End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement