|
Dim oApp As Object
Dim oappwork As Excel.Workbook, oappwork_sheet1 As Excel.Worksheet
Set oApp = CreateObject("Excel.Application")
oApp.Visible = False
If Me.框架0 = 1 Then Set oappwork = oApp.Workbooks.Open("D:\Mymis\XLS\制成率分析.xls")
Set oappwork_sheet1 = oappwork.Worksheets("sheet1")
oappwork_sheet1.cells(1, 1) = DLookup("[gsmc]", "tabcompanyinfo")
With Me.cr.SourceObject.Form.Recordset
.MoveFirst ‘子窗体CR未邦定而是选择 Me.cr.SourceObject = "制成率窗体"来的,提示对象变量或WITH块变量未设置,请问如何改·
nn = .Fields.count
j = 5
Do
If .EOF Then
Exit Do
Else
For i = 1 To nn - 1
oappwork_sheet1.cells(j, 0 + i) = .Fields(i)
Next i
j = j + 1
.MoveNext
End If
Loop
MsgBox "已形成报表,请确认后打印!", vbInformation, "MIS"
oApp.Visible = True
End With
On Error Resume Next
oApp.UserControl = True |
|