mysql二维数组vb

编程入门 行业动态 更新时间:2024-10-09 22:20:00

mysql二维<a href=https://www.elefans.com/category/jswz/34/1771288.html style=数组vb"/>

mysql二维数组vb

首先建立一个JS脚本文件,并保存为helloworld.wsc

脚本内容如下:

Function CreateVBArray(excel,y,z)

Dim i,j,a,b

Dim strArr()

a=y

b=z

redim strArr(a,b)

For i=0 to y

For j=0 to z

strArr(i,j) = 5

Next

Next

scol = GetCellColumnNumber( z )

excel.range("a1:" + scol + CStr(y) ) = strArr

End Function

'下面这个函数是转化EXCEL列数字为字母,譬如 27 = "AA"列

Function GetCellColumnNumber(iColumnCount)

iColumnCount = iColumnCount - 1

If iColumnCount < 26 Then

GetCellColumnNumber = Chr(iColumnCount + Asc("A"))

Else

GetCellColumnNumber = Chr(iColumnCount / 26 - 1 + Asc("A")) + Chr(iColumnCount Mod 26 + Asc("A"))

End If

End Function

//保存文件之后,右击文件并点击注册!注册成功之后该脚本已经做为一个组件注册到系统中!

接下来说说PB对它的调用//

OleObject JsComponent

JsComponent = create OleObject

li_conn = JsComponent.connecttonewobject( "hello.world" )

If li_conn = 0 Then

Jscomponent.CreateVBArray( excel,5,53 )

End If

很简单吧 PB就这么实现了动态二维数组粘贴excel区域的操作

总结

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。

如您喜欢交流学习经验,点击链接加入交流1群:1065694478(已满)交流2群:163560250

更多推荐

mysql二维数组vb

本文发布于:2024-02-07 08:05:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1754711.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数组   mysql   vb

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!