Private Sub Command3_Click()
If Dir(iXLFileName) <> "" Then
Set iXLApp = CreateObject("Excel.Application")
With iXLApp
.DisplayAlerts = False
.Visible = True
With .Workbooks.Open(FileName:=iXLFileName, UpdateLinks:=3)
inumber = Label4.Caption
With ActiveWorkbook
'Ошибка тут
.Sheets("1").Cells(1, 3) = Label20.Caption & " " & Text15.Text & " " & Label21.Caption & " " & Text16.Text & " " & Label22.Caption & " " & Label24.Caption
.Sheets("1").Cells(5, 4) = Label1.Caption
.Sheets("1").Cells(5, 5) = inumber
If dat = 1 Then
.Sheets("1").Cells(5, 5) = inumber
iXLFileName = .Path & "\Наряд\Наряд_" & inumber & "_.xls"
.SaveAs FileName:=iXLFileName, FileFormat:=xlNormal
.Close
End If
End With
.Quit
.DisplayAlerts = True
Unload Form1
Set Form1 = Nothing
Form1.Show
End With
Set iXLApp = Nothing
End If
End sub
Set iXLApp = CreateObject("Excel.Application")
With iXLApp
Сейчас этот форум просматривают: SemrushBot, Yandex-бот и гости: 112