标题:如何将MSFlexgrid中的数据导入Excel
取消只看楼主
我爱问
Rank: 2
等 级:论坛游民
帖 子:9
专家分:10
注 册:2016-5-4
结帖率:100%
已结贴  问题点数:16 回复次数:1 
如何将MSFlexgrid中的数据导入Excel
Public Sub OutDataToExcel(Flex As MSFlexGrid)
Dim s As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
OnError
GoTo Ert
Me.MousePointer = 11
Dim Excelapp As Excel.Application
Set Excelapp = New Excel.Application
OnError
Resume NextDoEvents
Excelapp.SheetsInNewWorkbook = 1
Excelapp.Workbooks.Add
Excelapp.ActiveSheet.Cells(1, 3) = s
Excelapp.Range(C1).Select
Excelapp.Selection.Font.FontStyle = Bold
Excelapp.Selection.Font.Size = 16
With Flexk = .Rows
For i = 0 To k - 1
For j = 0 To .Cols - 1
DoEvents
Excelapp.ActiveSheet.Cells(3 + i, j + 1) = TextMatrix(i, j)
Next j
Next i
End With
Me.MousePointer = 0
Excelapp.Visible = True
'Excelapp.Sheets.PrintPreviewErt:
'If Not (Excelapp Is Nothing) Then
'Excelapp.Quit
'End If
End Sub
想问一下各位大神这个程序为什么在执行的时候会出现子程序或函数未定义?
搜索更多相关主题的帖子: Excel 如何 
2016-05-12 10:23
我爱问
Rank: 2
等 级:论坛游民
帖 子:9
专家分:10
注 册:2016-5-4
得分:0 
谢谢各位大神点拨
2016-05-13 10:00



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




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

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