引用 ms graph 9.0 object
代码如下
On Error GoTo Err_Normal
Dim i As Integer
Dim lRow As Long
OLE1.Format = "CF_TEXT" ' 置文件格式为文本方式。
OLE1.SizeMode = 1
OLE1.CreateEmbed "", "MSGRAPH" '建立内嵌对象
OLE1.AutoActivate = 0 '关闭编辑
OLE1.AutoVerbMenu = False
Dim oGraphChart As Graph.Chart
Set oGraphChart = OLE1.object
oGraphChart.ChartType = xl3DAreaStacked 'xl3DArea
' OLE1.object.ChartType = -4098 'xl3DAreaStacked
' OLE1.OLEType
Dim Msg, NL, TB ' 变量声明。
Dim sMCaption As String '头
Dim smsgArray() As String '列数据
Dim sTmp As String
TB = Chr(9) ' Tab 字符。
NL = Chr(10) ' 换行字符。
If arec.State = 0 Then Exit Function
If arec.RecordCount <= 0 Then Exit Function
ReDim smsgArray(arec.Fields.Count - 1)
For i = 0 To arec.Fields.Count - 1
smsgArray(i) = NL & arec.Fields(i).Name
Next i
lRow = 0
While Not arec.EOF
sMCaption = sMCaption & TB & arec.Fields(0).Value
For i = 0 To arec.Fields.Count - 1
smsgArray(i) = smsgArray(i) & TB & arec.Fields(i)
Next i
arec.MoveNext
Wend
For i = 0 To UBound(smsgArray)
' If smsgArray(i) <> "" Then
' smsgArray(i) = Mid(smsgArray(i), 1, Len(smsgArray(i)) - 1)
' End If
Msg = Msg & smsgArray(i)
Next i
Msg = sMCaption & Msg
Debug.Print Msg
OLE1.DoVerb -3
If OLE1.AppIsRunning Then
OLE1.DataText = Msg
' 更新该对象。
OLE1.Update
Else
MsgBox "Graph isn't active."
End If注意到这个xl3DAreaStacked 了吧,9.0里定义的,怎么把它们全都找出来?
我不想引用这个9.0动态库
代码如下
On Error GoTo Err_Normal
Dim i As Integer
Dim lRow As Long
OLE1.Format = "CF_TEXT" ' 置文件格式为文本方式。
OLE1.SizeMode = 1
OLE1.CreateEmbed "", "MSGRAPH" '建立内嵌对象
OLE1.AutoActivate = 0 '关闭编辑
OLE1.AutoVerbMenu = False
Dim oGraphChart As Graph.Chart
Set oGraphChart = OLE1.object
oGraphChart.ChartType = xl3DAreaStacked 'xl3DArea
' OLE1.object.ChartType = -4098 'xl3DAreaStacked
' OLE1.OLEType
Dim Msg, NL, TB ' 变量声明。
Dim sMCaption As String '头
Dim smsgArray() As String '列数据
Dim sTmp As String
TB = Chr(9) ' Tab 字符。
NL = Chr(10) ' 换行字符。
If arec.State = 0 Then Exit Function
If arec.RecordCount <= 0 Then Exit Function
ReDim smsgArray(arec.Fields.Count - 1)
For i = 0 To arec.Fields.Count - 1
smsgArray(i) = NL & arec.Fields(i).Name
Next i
lRow = 0
While Not arec.EOF
sMCaption = sMCaption & TB & arec.Fields(0).Value
For i = 0 To arec.Fields.Count - 1
smsgArray(i) = smsgArray(i) & TB & arec.Fields(i)
Next i
arec.MoveNext
Wend
For i = 0 To UBound(smsgArray)
' If smsgArray(i) <> "" Then
' smsgArray(i) = Mid(smsgArray(i), 1, Len(smsgArray(i)) - 1)
' End If
Msg = Msg & smsgArray(i)
Next i
Msg = sMCaption & Msg
Debug.Print Msg
OLE1.DoVerb -3
If OLE1.AppIsRunning Then
OLE1.DataText = Msg
' 更新该对象。
OLE1.Update
Else
MsgBox "Graph isn't active."
End If注意到这个xl3DAreaStacked 了吧,9.0里定义的,怎么把它们全都找出来?
我不想引用这个9.0动态库
解决方案 »
- VB6中向excel写数据,无法获取第二个工作薄对象?
- 我的listbox为什么不显示treeview中的项目内容
- vb6.0 中listview 的问题 ,hurry!!!
- 公历转农历的代码
- 在picturebox画点画线后,需要放大10倍并有网格显示,而且(放大10倍后)可以拉动滚动条显示其它部分而且要可以画点,请问解决此问题最佳方法?
- 在VB中用ADO创建一个MDB数据库文件如何创建,是CREATE DATABASE吗,有没有代码例子呀,谢谢
- 求拜特出纳票据打印软件的注册码!!
- VB6.0中的消息是一种什么概念--在线等待----
- 这样的SQL语句写法,找出符合要求的记录,内详.
- 如何让textbox的背景为透明啊????
- 参数引用调用无效,问为什么
- 存储过程返回值
我是来接分的