Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro for exporting sheets and objects as jpg

Hi,

I need to export different sheets and objects as jpg. I have this script today:

sub ExportBitmapToFile
GraphPath = "X:\Development\Eskilstuna Energi och Miljö AB\Export\"
ActiveDocument.Sheets("SH15").ExportBitmapToFile GraphPath & "Ekonomi_Alla.jpg"
end sub


sub ExportBitmapToFile_2
GraphPath = "X:\Development\Eskilstuna Energi och Miljö AB\Export\"
ActiveDocument.Sheets("SH16").ExportBitmapToFile GraphPath & "Ekonomi_Detaljer.jpg"
end sub


sub ExportBitmapToFile_3
GraphPath = "X:\Development\Eskilstuna Energi och Miljö AB\Export\"
ActiveDocument.GetSheetObject("CH115").ExportBitmapToFile GraphPath & "Ekonomi_Totalt.jpg"
end sub

But when this is run (OnPostReload) only the active sheet, or object from active sheet are exported. Can I activate sheet in some way to be able to export things on different sheets no matter how the app is saved?

Best regards

 

Torbjörn Ungvall (@Ungvall)

Senior Business Discovery Manager

Advectas AB

11 Replies
Not applicable
Author

Also - is there a way to control image size of exported sheets?

Best regards

Torbjörn Ungvall (@Ungvall)

Senior Business Discovery Manager

Advectas AB

Not applicable
Author

Please note that this function is NOT creating JPG files, it always exports to BMP (Bitmap) format irrespective of what you call the file. You can verify this for yourself but looking at the file in a hex editor and seeing that the header records conform to BMP file structure and NOT JPG