P
Paulo
why do I get erro #9 @ printing?
i have a other sub that runs the same line in the local woorkbook and ptints
just fine.
I thank in advance
Sub Imprimidor()
' On Error GoTo Fim
Dim x As Long
Dim Y As Long
Dim Formul As String
Dim Seq As Long
Dim Adit As String
Dim Clie As String
Dim Caminho As String
Y = Range("E1")
For x = Y To 27
Seq = Cells(x, "a").Value
Adit = Cells(x, "b").Value
Clie = Cells(x, "c").Value
Range("D" & x).Value = "ok"
Caminho = "\\Servidor\dados\ADITIVOS\" & Clie & "\(" _
& Seq & ") " & Clie & " aditivo " & Adit & " -TC- 1008 -
N.xls"
Debug.Print Caminho
Workbooks.Open Caminho
ActiveWorkbook.UnprotectSharing
If ActiveWorkbook.MultiUserEditing Then ActiveWorkbook.ExclusiveAccess
'If ActiveWorkbook.ProtectStructure = True Then
Sheets(4).Unprotect "CECAPF"
Sheets(4).Range("C39").Formula = "=round((0.25*$c$24),2)"
Workbooks.Open(Filename:= _
"C:\Arquivos de programas\Microsoft
Office\OFFICE11\Bibliote\Analise\ATPVBAEN.XLA" _
).RunAutoMacros Which:=xlAutoOpen
Calculate
'Sheet1.Range("c2").Select
''Workbooks(Caminho).Save
'Printing
Worksheets(4).PrintOut
MsgBox "Vire A página"
Worksheets(2).PrintOut
Worksheets(4).Protect "CECAPF"
Worksheets(1).Range("c2").Select
'Workbooks(Caminho).Save
Workbooks(Caminho).Close SaveChanges:=True
Next
end sub
i have a other sub that runs the same line in the local woorkbook and ptints
just fine.
I thank in advance
Sub Imprimidor()
' On Error GoTo Fim
Dim x As Long
Dim Y As Long
Dim Formul As String
Dim Seq As Long
Dim Adit As String
Dim Clie As String
Dim Caminho As String
Y = Range("E1")
For x = Y To 27
Seq = Cells(x, "a").Value
Adit = Cells(x, "b").Value
Clie = Cells(x, "c").Value
Range("D" & x).Value = "ok"
Caminho = "\\Servidor\dados\ADITIVOS\" & Clie & "\(" _
& Seq & ") " & Clie & " aditivo " & Adit & " -TC- 1008 -
N.xls"
Debug.Print Caminho
Workbooks.Open Caminho
ActiveWorkbook.UnprotectSharing
If ActiveWorkbook.MultiUserEditing Then ActiveWorkbook.ExclusiveAccess
'If ActiveWorkbook.ProtectStructure = True Then
Sheets(4).Unprotect "CECAPF"
Sheets(4).Range("C39").Formula = "=round((0.25*$c$24),2)"
Workbooks.Open(Filename:= _
"C:\Arquivos de programas\Microsoft
Office\OFFICE11\Bibliote\Analise\ATPVBAEN.XLA" _
).RunAutoMacros Which:=xlAutoOpen
Calculate
'Sheet1.Range("c2").Select
''Workbooks(Caminho).Save
'Printing
Worksheets(4).PrintOut
MsgBox "Vire A página"
Worksheets(2).PrintOut
Worksheets(4).Protect "CECAPF"
Worksheets(1).Range("c2").Select
'Workbooks(Caminho).Save
Workbooks(Caminho).Close SaveChanges:=True
Next
end sub