|
Dim xlApp As Excel.Application 'Excel应用程序对象
Dim xlBook As Excel.Workbook 'Excel工作簿对象
Dim xlSheet As Excel.Worksheet 'Excel工作表对象
dim rs as aododb.recordset
dim step as string
dim i as integer
set rs=new adodb.recordset
Set xlApp = CreateObject("Excel.Application") '创建Excel应用程序对象
Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open(Me.Excel完整路径)
SheetName = Me.工作表名
Set xlSheet = xlBook.Sheets(SheetName)
step="select*from RYZL"
rs.Open step, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rs.addnew
rs("XM")=Cells(1, 1)
因为EXCEL表中XM列会变动,所以,我想自动获得XM的列数 |
|