回 帖 发 新 帖 刷新版面

主题:导出excel报错

Private Sub Command3_Click()
On Error Resume Next
Dim i As Integer
Dim j As Integer
Dim XlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet

Set XlApp = CreateObject("Excel.Application")
XlApp.Visible = True
Set xlBook = XlApp.Workbooks.Add

Set xlSheet = xlBook.Worksheets(1)
xlBook.Worksheets(1).Name = "aa"
xlSheet.Cells(1, 1) = "a"
xlSheet.Cells(1, 2) = "b"
xlSheet.Cells(1, 3) = "c"
xlSheet.Cells(1, 4) = "d"
xlSheet.Cells(1, 5) = "e"
xlSheet.Cells(1, 6) = "f"
xlSheet.Cells(1, 7) = "g"
xlSheet.Cells(1, 8) = "h"
xlSheet.Cells(1, 9) = "i"
xlSheet.Cells(2, 1).CopyFromRecordset DataGrid1.DataSource

End Sub


执行时报错定义的应用程序或对象错误,请哪位高手帮忙看看

0

回复列表 (共2个回复)

沙发

什么错。怎么错。截图

板凳

在线博彩平台:www.pb258.com
在线博彩平台:www.jjxtech.com 
在线博彩平台:www.lcmty.com 
在线博彩平台:www.7macau.com
在线博彩平台:www.7macau.net
在线博彩平台:www.bp258.com
在线博彩平台:www.258bp.com
博狗:http://679.258bp.com
博狗:http://680.258bp.com
博狗:http://681.258bp.com
博狗:http://682.258bp.com
博狗:http://683.258bp.com
博狗:http://684.258bp.com
博狗:http://685.258bp.com
博狗:http://686.258bp.com
博狗:http://687.258bp.com
博狗:http://688.258bp.com
博狗:http://689.258bp.com
博狗:http://690.258bp.com
博狗:http://691.258bp.com
博狗:http://692.258bp.com
博狗:http://693.258bp.com
博狗合营:http://694.258bp.com
888真人:http://695.258bp.com
888真人:http://696.258bp.com
888真人:http://697.258bp.com
加百利:http://698.258bp.com
加百利:http://699.258bp.com 
必威:http://700.258bp.com
必威:http://701.258bp.com
必威:http://702.258bp.com
必威:http://703.258bp.com
必威:http://704.258bp.com
必威:http://705.258bp.com
必威:http://706.258bp.com
必威合营:http://707.258bp.com
新博:http://708.258bp.com
鸿运国际:http://709.258bp.com
鸿运国际:http://710.258bp.com
鸿运国际:http://711.258bp.com
新橙娱乐:http://712.258bp.com
新橙娱乐:http://713.258bp.com
新橙娱乐:http://714.258bp.com
新橙娱乐:http://715.258bp.com
新橙娱乐合营:http://716.258bp.com
乐虎:http://717.258bp.com
乐虎:http://718.258bp.com
乐虎:http://719.258bp.com
乐虎:http://720.258bp.com
乐虎:http://721.258bp.com
乐虎:http://722.258bp.com
亚虎:http://723.258bp.com
亚虎:http://724.258bp.com
亚虎:http://725.258bp.com
龙8国际娱乐:http://726.258bp.com
龙8国际娱乐:http://727.258bp.com
龙8国际娱乐:http://728.258bp.com
龙8国际娱乐:http://729.258bp.com
龙8国际娱乐:http://730.258bp.com
龙8国际娱乐:http://731.258bp.com
必博:http://2274.bbo233.com
必博:http://2274.bbo998.com

我来回复

您尚未登录,请登录后再回复。点此登录或注册