hi all
i know this is pretty simple but is there anybody has a code that writes to an excel file.
thanks again....
:D
Printable View
hi all
i know this is pretty simple but is there anybody has a code that writes to an excel file.
thanks again....
:D
VB Code:
'NOTE: ADD REFERENCE TO MICROSOFT EXCEL 8.0/9.0 LIBRARY Public Sub WriteCell(ByVal FileName As String, ByVal SheetIndex As Long, ByVal Cell As String, ByVal CellValue As String) Dim app As New Excel.Application, mybook As Excel.Workbook Dim tmp As Excel.Worksheet Set mybook = app.Workbooks.Open(FileName) mybook.Worksheets(SheetIndex).Range(Cell).Value = CellValue mybook.Close True End Sub
Thanks guys... but there are errors when i run them. i guess its on the OS. im using NT 4. the error does not comes out if run on another OS.
The error message is "Active X component can't crate object"
ive check the necessary things at the REFERENCE SECTION...
hope to resolve this soon.
Thanks...
:confused: