Vídeo recomendado
https://youtu.be/diWPPPhW-9E

Gerar Arquivo PDF com Bloqueio de edição

Fórum para dúvidas sobre os fundamentos da linguagem de programação Visual Basic no contexto do VBA
DehCarneiro
Acabou de chegar
Acabou de chegar
Mensagens: 5
Registrado em: Seg Jan 18, 2021 4:57 pm

Gerar Arquivo PDF com Bloqueio de edição

Mensagem por DehCarneiro »

Bom dia a todos!

Estou com uma necessidade que, após gerar o arquivo pdf, preciso que ele seja salvo com um bloqueio de edição...como posso realizar esse procedimento?

Desde já meu muito obrigado!

Segue o codigo que montei para gerar o arquivo...

linha = 2
linha_fim = Range("AA2").End(xlDown).Row

While linha <= linha_fim
Cells(linha, 27).Copy
Range("B5").PasteSpecial
Application.CutCopyMode = False
If Range("D1") = "Ativo" And Range("C25").Value > 0 Then
Sheets.Add after:=Sheets(Sheets.Count)
Nome = ("Sht1")
ActiveSheet.Name = Nome
Dim Plan As Worksheet, Imagem As Shape

ext_a = Worksheets("Plan1").Range("B5").Value
ext_b = Worksheets("Plan2").Cells.Find(ext_a).Column
ext_c = Worksheets("Plan2").Cells(Rows.Count, ext_b).End(xlUp).Row
Worksheets("Plan1").Range("A7") = Worksheets("Plan2").Cells(ext_c, 1)

Set Plan = ActiveSheet
Set Imagem = Plan.Shapes.AddPicture("C:\Users\Desktop\SVCG Files\Logo.jpg", msoFalse, msoCTrue, 5, 5, 170, 50)
Sheets("Plan1").Range("A1:C27").Copy
Sheets("Sht1").Range("A1:C27").PasteSpecial
Application.CutCopyMode = False
Sheets("Sht1").Columns(1).AutoFit
Sheets("Sht1").Columns(2).ColumnWidth = 50
Sheets("Sht1").Columns(3).ColumnWidth = 50

Worksheets("Sht1").PageSetup.Orientation = xlLandscape

Sheets("Sht1").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\ " & [C5] & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
Application.DisplayAlerts = False
Sheets("Sht1").Delete
Sheets("Plan1").Select
Application.DisplayAlerts = True
linha = linha + 1
Else
linha = linha + 1
End If


Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider a Donation to support the site.


Responder