ms Graph Chart 控制
引用 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动态库
[解决办法]
帮顶
[解决办法]
^^米老鼠网
我是来接分的