Dim oBook As Object
Dim oSheet As Object
'Apro il nuovo file excel
Set oExcel = CreateObject("Excel.Application")
Dim Aperto As Boolean
'verifico se il file è aperto
Aperto = FileAperto(Me.FilePreventivoTxt.Value)
If Aperto = True Then
MsgBox "Attenzione: il file del preventivo è APERTO" & vbCrLf & "Chiuderlo e riprovare", vbCritical, "File aperto"
Exit Sub
Else
Set oBook = oExcel.Workbooks.Open(Me.FilePreventivoTxt.Value)
oExcel.Visible = True
DoEvents
End If
'proseguo
x = 6
If obook.ListaMateriali.Cells(x, obook.LM.LMFamiglia).Value <> "" Then
While obook.ListaMateriali.Cells(x, obook.LM.LMFamiglia).Value <> ""
x = x + 1
Wend
|