|
-
May 17th, 2000, 05:57 AM
#1
Thread Starter
Addicted Member
ok i have asked this once before but i seem to lost that thread so here goes again:
I need to export the contents of a datagrid/dbgrid to excel, does anyone know how to do this quick (without having to loop thru the rows and cols)?
-
May 17th, 2000, 04:11 PM
#2
Addicted Member
Hope this will do
This is what i used once in a project i hope it is usefull
Dim FS
Dim Book
'set up dialog box
Dialog.Flags = &H4006
Dialog.DialogTitle = DialogTitle.Caption
Dialog.CancelError = True
Dialog.InitDir = "C:\"
Dialog.DefaultExt = "csv"
Dialog.ShowSave
FS = ";"
Open Dialog.FileName For Output Shared As #1
Print #1, "DATA"
With Data1.Recordset
Book = .Bookmark
.MoveFirst
Do Until .EOF
Print #1, !Field1; FS; !Field2
.MoveNext
Loop
.Bookmark = Book
End With
Close 1
ASTERIX
Remember Programmers don't sleep 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|