Boa tarde,
Pessoal estou com a macro abaixo e necessito que o arquivo seja exportado com o nome que se encontar na celula c9 da planilha.
Poderiam me ajudar?
Sub SalvaFotosPrincipal()
Dim nome_arquivo As String
nome_arquivo = Worksheets("SOLIC_INATIVACAO").Range("c9")
Path = Sheets("CONFIG").Range("C1")
Call SalvarImagemVenda
'Call SalvarImagemIncentivo
Sheets("SOLIC_INATIVACAO").Select
Shell "C:WINDOWSexplorer.exe " & Path, vbMaximizedFocus
End Sub
Sub SalvarImagemVenda()
''' Set Range you want to export to file
Sheets("SOLIC_INATIVACAO").Select
Dim rgExp As Range: Set rgExp = Sheets("SOLIC_INATIVACAO").Range("a1:n29")
''' Copy range as picture onto Clipboard
rgExp.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
''' Create an empty chart with exact size of range copied
'Place from save all pictures
Path = Sheets("CONFIG").Range("C1")
With ActiveSheet.ChartObjects.Add(Left:=rgExp.Left, Top:=rgExp.Top, _
Width:=rgExp.Width, Height:=rgExp.Height)
.Name = "ChartVolumeMetricsDevEXPORT"
.Activate
End With
''' Paste into chart area, export to file, delete chart.
ActiveChart.Paste
ActiveSheet.ChartObjects("ChartVolumeMetricsDevEXPORT").Chart.Export Path & "SOLICITAÇÃO INATIVACAO - " & nome_arquivo & ".jpg"
ActiveSheet.ChartObjects("ChartVolumeMetricsDevEXPORT").Delete
End Sub
Postado : 22/08/2018 12:53 pm