Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there a way to change the screen resolution with a macro?
I don't think so, but you can allow zooming with macros:
Sub ZoomFitToWindow
ActiveDocument.ActiveSheet.FitZoomToWindow
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
End Sub
sub ZoomIn
set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = sp.ZoomFactor * 1.1
mysheet.SetProperties sp
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
end sub
sub ZoomOut
set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = sp.ZoomFactor * 0.9
mysheet.SetProperties sp
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
end sub
Sub ZoomNormal
set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = 1
mysheet.SetProperties sp
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
End Sub
I know how to change the zoom.
I want to take a screenshot/picture of a sheet with a macro, and the zoom function won't work with my macro for saving a picture.
Here is my macro for export a picture:
public function ExportImage
vFolder = Destination folder
ActiveDocument.GetSheetByID ("SH02").Activate
set obj = ActiveDocument.GetSheetByID("SH02")
ActiveDocument.GetApplication.WaitForIdle
fileName = "SH02" & ".jpg"
ActiveDocument.GetApplication.WaitForIdle
obj.ExportBitmapToFile vFolder & fileName
end function
Any other ideas for doing this?
When I use the export function all objects will be exported in its original size, but the window(picture) size will change to the resolution I have set the window to.
Did you ever find a solution to this?
I am most likely trying to exactly the same and am stuck between resolutions for a logged on computer, the server default resolution etc.
Kind regards
Niklas