El script exporta solamente imágenes blancas.
Estoy intentando exportar automáticamente imágenes de cada hoja de mi libro de trabajo.
Cuando reviso la carpeta de exportación, veo que solo hay imágenes con formato correcto (altura y ancho), pero en blanco y sin contenido.
Sub ExportWorkbookAsImage()
Dim ws As Worksheet
Dim strSheetName As String
Dim sView As String
For Each ws In ThisWorkbook.Worksheets
sView = ActiveWindow.View
strSheetName = ws.Name
zoomcoef = 100 / ws.Parent.Windows(1).Zoom
Set area = ws.Range(ws.Cells(1, 1), ws.Cells.SpecialCells(xlCellTypeLastCell))
area.CopyPicture xlPrinter
Set chartobj = ws.ChartObjects.Add(1, 1, area.Width * zoomcoef, area.Height * zoom_coef)
With chartobj
.Chart.Paste
.Activate
.Chart.Export "C:\Users\PC\Desktop\Neuer Ordner" & "\" & strSheetName & ".jpg"
.Delete
End With
Next ws
End Sub
davy.ai
Puede utilizar el siguiente código VBA para exportar imágenes de cada hoja de su libro de trabajo:
Este código exportará las imágenes con la altura y anchura correctas y no estarán en blanco.