|
-
Jul 5th, 2001, 12:49 AM
#1
Thread Starter
Lively Member
Writing to specific fields in Access
Dim objExcel As Excel.Application
Set objExcel = New Excel.Application
objExcel.Workbooks.Open "C:\My Documents\book1.xls"
objExcel.Visible = True
For lngCount = 1 To UBound(arrPT1)
objExcel.ActiveSheet.Range("A" & lngCount + 1).Value = arrPT1(lngCount)
objExcel.ActiveSheet.Range("B" & lngCount + 1).Value = arrPT2(lngCount)
objExcel.ActiveSheet.Range("C" & lngCount + 1).Value = arrPT3(lngCount)
objExcel.ActiveSheet.Range("D" & lngCount + 1).Value = arrPT4(lngCount)
objExcel.ActiveSheet.Range("E" & lngCount + 1).Value = arrPT5(lngCount)
objExcel.ActiveSheet.Range("F" & lngCount + 1).Value = arrPT6(lngCount)
Next lngCount
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close False
objExcel.Quit
Set objExcel = Nothing
End Sub
------------------------------------------------------------------------------------
That is the code that my program uses to write an excel file. I need my program to also make the same file, but as a access file. How would i open a access file, and effectively do the same thing but using access instead?
arrPT1 - arrPT6 are just arrays of strings.
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
|