|
-
Dec 7th, 2002, 11:59 AM
#1
Thread Starter
Junior Member
Quick question
Can anyone tell me why this code will not work on my 98 machine??
Private Sub Command1_Click()
Dim xlapp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
Set xlapp = New Excel.Application
Set xlbook = xlapp.Workbooks.Add
Set xlsheet = xlbook.Worksheets.Add
xlsheet.Cells(3, 1).Value = "ASDFASDFA"
xlsheet.SaveAs "C:\Documents and Settings\Chris Wilson\Desktop\temp.xls"
xlapp.Quit
Set xlapp = Nothing
Set xlbook = Nothing
Set xlsheet = Nothing
End Sub
It compiles and runs fine on my XP machine but when it encounters the set xlsheet line it gives me a runtime error!!??
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
|