我在将Excel数据导入到Access中时总是提示"Worksheet"不能发现,但是我如果先用程序将Access中数据导入,再导入时就没有这种错误,请问这是什么原因?是不是我的数据访问组件版本过低?还是需要特殊的配置
解决方案 »
- 救命啊!!这个控件过期了:实在是郁闷。(九州软件的coolbutton)
- 购买权限设置源码
- 请问如何让两条消息不会合并
- 数据校验
- 谁会VB语言转成PB语言(关于OLE)
- 如何通过IP实现远程访问SQL Server,急!!!!
- 如何操作recordset,使其能够手动付值!即用
- 用VB做安装程序咋做?
- 怎样做一个能生成帮助文件(.hlp)的程序,
- ★★注意★★:在Interdev中,ASP文件可以调试,但调试之前总提示"Unable to set server into debugging state automatically....",Why
- 怎么样实现 .dbf格式数据导入到SQL sever中!急急急急急
- access表怪现象,请指导,谢谢
Sheet名称正确,加上$符号还是不行to cuizm(射天狼) ( )
对象都定义了,而且导入的如果是用我程序导出的Excel文件时就完全正常:(
Dim appExcel As New Excel.Application
Dim wbExcel As New Excel.Workbook
Dim temp As Excel.Worksheet
Dim strTest As String
comDlg.ShowOpen
If comDlg.filename = "" Then
Exit Function
Else
xlsFile = comDlg.filename
End If g_genConn.Execute "drop table temp"
Set wbExcel = appExcel.Workbooks.Open(xlsFile) '打开Excel文件
frmExcelsheet.Combo1.Clear '我在这里将Excel中的Sheet表加入到Combo1中
For Each temp In wbExcel.Worksheets
frmExcelsheet.Combo1.AddItem temp.Name
Next
If frmExcelsheet.Combo1.ListCount > 0 Then frmExcelsheet.Combo1.ListIndex = 0
frmExcelsheet.show vbModal
appExcel.Quit
Set appExcel = Nothing
Set wbExcel = Nothing
Set temp = Nothing
strTest = frmExcelsheet.returnStr '返回用户选择的Sheet表名字
If strTest = "" Then
MsgBox "没有选择待导入的表!", vbCritical, "提示"
Exit Function
End If
'清除完成
If Rs.State Then Rs.Close
'下面这一句话出错!!!!!!!!!!!!!!!!!!!!!!!!!!
'提示我指定的Sheet表没有找到
g_genConn.Execute "select * into temp from [excel 8.0;database=" & xlsFile & "].[" & strTest & "]"
appExcel.Quit
Set temp = Nothing
Set wbExcel = Nothing
Set appExcel = Nothing
end sub
放到最后试试
我没做过excel做数据源 不过你在前边释放了所有excel资源