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
Export data to an Excel file
Author:
Ionescu Daniel Mihai
E-mail:
Click to e-mail author
Submitted:
7/30/2003
Version:
VB6
Compatibility:
VB6
Category:
Controls
Views:
30667
This code allows to export the data contained in a MSHFlexGrid control to an .xls (Excel type) file.
Declarations:
Dim nfile As Integer
Code:
For i = 0 To nbr - 1 For j = 0 To MSHFlexGrid1.Cols - 1 Spreadsheet1.Cells(i + 1, j + 1) = MSHFlexGrid1.TextMatrix(i, j) Next Next nfile = FreeFile Open "filea" For Output As #nfile Close #nfile FileCopy "filea", App.Path & CStr(Day(Now) & "_" & Month(Now) & "_" & Year(Now)) & ".xls" Spreadsheet1.ActiveSheet.Export (App.Path & CStr(Day(Now) & "_" & Month(Now) & "_" & Year(Now)) & ".xls")
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement