Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
  • Avatar do usuário
Por Nelsonldias
#56061
Boa tarde...

Necessito de ajuda...
Precisava de um codigo Vba que
Quando carregar em cima "folhax" abra automaticamente a janela do Gravar Em Pdf

O caminho onde é salvo... escolho eu à posteriormente no momento (depende do dia... etc)

(Se for possível ter apenas metade do caminho tambem era bom)

O nome é o do ficheiro

Mas queria que a opção Pdf estivesse logo selecionada..

É possivel ajudarem me??



Mas queria que a opção
Por babdallas
#56244
Use o método GetOpenFileName para obter o caminho de onde vc quer salvar o arquivo pdf. Depois disso use o método ExportAsFixedFormat para salvar como PDF.

https://docs.microsoft.com/pt-br/office ... enfilename
http://www.vbaacademy.com.br/aula-62-o- ... ename-vba/

https://docs.microsoft.com/pt-br/office ... ixedformat
https://www.youtube.com/watch?v=t57uDi2jDbc
Avatar do usuário
Por mucascosta
Posts Avatar
#56525
Tente assim:

Private Sub Workbook_Activate()
Dim Arq As String
Range("A1").Select
ActiveWindow.View = xlPageLayoutView
ActiveWindow.View = xlNormalView

With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Buscar pasta"
.InitialFileName = ThisWorkbook.Path
.Show
.AllowMultiSelect = False
Pasta = .SelectedItems(1)
End With

Arq = InputBox("informe o nome do PDF")

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Pasta & "\" & Arq & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties _
:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord