cdata该怎么定义?
Option Explicit
Dim appexcel As New Excel.Application
Private Sub Command1_Click()
Dim icol As Integer, irow As Integer
Dim wsheet As Worksheet
Dim wbook As Workbook
Set wbook = appexcel.Workbooks.Add
Set wsheet = appexcel.Sheets(1)
wsheet.Cells(1, 1).Value = "1st Quarter"
wsheet.Cells(2, 2).Value = "2nd Quarter"
appexcel.Visible = True
wsheet.SaveAs "c:\test.xls"
appexcel.Quit
appexcel.Range("A2:E3").Select
Set cdata = appexcel.Selection
For icol = 1 To 5
For irow = 1 To 2
Text1.Text = Text1.Text & Chr(9) & cdata(irow, icol)
Next
Text1.Text = Text1.Text & vbCrLf
Next
End Sub
运行就说变量未定义
cdata 该怎么定义?
[此贴子已经被作者于2007-9-9 10:35:09编辑过]