|
-
December 17th, 1998, 05:46 PM
#1
save data into Excel file
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
-
January 5th, 1999, 04:17 PM
#2
Re: save data into Excel file
Hi,
3 questions:
- is it the same version of Excel ?
- what's the error message ? (Ole automation or ...)
- Does your form show as modal ?
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
|