标题:cdata该怎么定义?
只看楼主
linfeng5329
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-9-6
 问题点数:0 回复次数:3 
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编辑过]

搜索更多相关主题的帖子: cdata 定义 
2007-09-09 10:34
multiple19O2
Rank: 1
等 级:新手上路
帖 子:326
专家分:0
注 册:2007-8-29
得分:0 
Dim CData
2007-09-09 10:55
心中有剑
Rank: 2
等 级:新手上路
威 望:5
帖 子:611
专家分:0
注 册:2007-5-18
得分:0 
...函数 也可以定义啊

2007-09-09 13:09
multiple19O2
Rank: 1
等 级:新手上路
帖 子:326
专家分:0
注 册:2007-8-29
得分:0 
否 数组。

Dim CData(,)
2007-09-09 13:44



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-168695-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.882519 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved