|
-
October 21st, 1999, 10:03 AM
#1
Dumping Data into Excel
I have an array of data which I would like to dump into an excel file, how is this done ?
-
October 21st, 1999, 11:38 AM
#2
Re: Dumping Data into Excel
Finally, something I can help with.
This is the code I use to dump to Excel, don't expect it to be the most
efficient since I am also a beginner programmer but it works fine:
Private Sub Command1_Click()
Set wkbObj = GetObject("C:\VBProjects\Path\File.XLS")
Dim i As Integer
E(40) = CDbl(wkbObj.Worksheets(1).Range("B1").Value)
End Sub
Private Sub Command2_Click()
Set wkbObj = GetObject("C:\VBProjects\Path\File.XLS")
Dim i As Integer
wkbObj.Worksheets(1).Range("B1").Value = E(40)
wkbObj.SaveAs "C:\VBProjects\HobVB\Hob.XLS"
End Sub
You will have to Reference Microsoft Excel Object Library.
I think that will wowk for dumping the variables, if you want to display them in your VB Project you will have to set-up the ADO Link (see Ch.7 VB Programmer's Guide)
-
October 22nd, 1999, 05:22 AM
#3
Re: Dumping Data into Excel
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
|