找回密码
 立即注册

QQ登录

只需一步,快速开始

CornsGrape

注册会员

10

主题

20

帖子

72

积分

注册会员

积分
72
CornsGrape
注册会员   /  发表于:2017-1-5 10:17  /   查看:3668  /  回复:7
Function GetText(Col As Long, Row As Long, Var) As Boolean
    Member of FPSpreadADO.fpSpread
    Returns the text of the specified cell.


第三个参数是什么意思??


7 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-1-5 12:09:12
沙发
最后一个参数是那个cell的text
http://sphelp.grapecity.com/WebH ... .html#funct233.html

评分

参与人数 1满意度 +5 收起 理由
CornsGrape + 5

查看全部评分

回复 使用道具 举报
CornsGrape
注册会员   /  发表于:2017-1-5 13:11:44
板凳
dexteryao 发表于 2017-1-5 12:09
最后一个参数是那个cell的text
http://sphelp.grapecity.com/WebHelp/Spread8/WebSiteHelp/webframe.html# ...

假设(1,1)单元格的值是“a1”
.GetText(1, 1, "a1")   报错:类型不匹配,既然是变体型的变量,那么应该是什么类型都可以传入吧。
如果把引号去掉,就会返回True;但即使输入的不是a1,也返回True。
请问这个是什么原因?
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-1-5 13:48:11
地板
看接口第三个参数是指针,您需要传递一个变量取接受获取到的text。 return 的值代表是否成功。
回复 使用道具 举报
CornsGrape
注册会员   /  发表于:2017-1-5 14:45:26
5#
dexteryao 发表于 2017-1-5 13:48
看接口第三个参数是指针,您需要传递一个变量取接受获取到的text。 return 的值代表是否成功。

Private Sub Command3_Click()
    Dim lstrVar As String
    With fpSpread1
        .Row = 1
        .Col = 1
        lstrVar = .Text
        MsgBox .GetText(1, 1, lstrVar)
    End With
End Sub


那这个程序错在哪里啊?
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-1-5 15:19:15
6#
您  lstrVar = .Text  就已经获取了 text 不需要再调用了GetText 了, 他们的作用是一样的都是获取单元格数据。
回复 使用道具 举报
CornsGrape
注册会员   /  发表于:2017-1-5 15:34:44
7#
dexteryao 发表于 2017-1-5 15:19
您  lstrVar = .Text  就已经获取了 text 不需要再调用了GetText 了, 他们的作用是一样的都是获取单元格数 ...

谢谢!问题解决~感谢耐心的回答!
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-1-5 15:51:18
8#
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部