vivian
December 17th, 1998, 04:46 PM
hi y'all:
I am programming in Visual Basic under windows NT, I try to save some data into an Excel file :"data.xls", it should be very simple, however, the code works well on Windows 98 and one computer running Windows NT, but NOT on another computer which is also running Windows NT.
Anyone knows the workaround? how should I set everything to make it work?
Thanks!
vivian
here is the part of code:
------------------------------------------------
Private Sub Command1_Click()
Dim x1 As Object
Dim sheet As Object
Set x1 = CreateObject("Excel.Application")
x1.Workbooks.Add
Set sheet = x1.ActiveWorkbook.Sheets(1)
x1.Visible = True
For i = 0 To 2
For j = 0 To 9
sheet.Cells(i + 1, j + 1).Value = i + j
Next j
Next i
sheet.SaveAs "c:\temp\data.xls"
x1.Quit
Set x1 = Nothing
End Sub
I am programming in Visual Basic under windows NT, I try to save some data into an Excel file :"data.xls", it should be very simple, however, the code works well on Windows 98 and one computer running Windows NT, but NOT on another computer which is also running Windows NT.
Anyone knows the workaround? how should I set everything to make it work?
Thanks!
vivian
here is the part of code:
------------------------------------------------
Private Sub Command1_Click()
Dim x1 As Object
Dim sheet As Object
Set x1 = CreateObject("Excel.Application")
x1.Workbooks.Add
Set sheet = x1.ActiveWorkbook.Sheets(1)
x1.Visible = True
For i = 0 To 2
For j = 0 To 9
sheet.Cells(i + 1, j + 1).Value = i + j
Next j
Next i
sheet.SaveAs "c:\temp\data.xls"
x1.Quit
Set x1 = Nothing
End Sub