I have a problem I can't seem figure out. I've been unable to find a solution after several days. I have an Excel file that is essentially a layout map of a building. The map is comprised of cells, cell borders, and shapes. I have a script which copies the map via UsedRange.CopyPicture. If I then display it via a SplashImage, the map looks fine. However, when displaying as a Picture control, it only shows the shapes, not the cells.
If anyone knows why it does this and/or some workaround, it would really be helpful. My only stipulation is I don't want to have to create and actual file as other co-workers will be using this on work laptops and if it writes a file to the drive it will send out red flags to our IT department.
Thank you much!
Here's my sample code:
Code: Select all
oXl := ComObjCreate("Excel.Application")
clipboard :=
Wrkbk := oxl.Workbooks.Open("C:\Excel_File.xlsx")
oRange := oxl.sheets("Layout").UsedRange.CopyPicture(,2)
if DllCall("OpenClipboard", "ptr", 0) {
if DllCall("IsClipboardFormatAvailable", "uint", 2) {
hBitmap := DllCall("GetClipboardData", "uint", 2, "ptr")
}
DllCall("CloseClipboard")
}
SplashImage, % "HBITMAP:*" hBitmap ;Show as SplashImage
Gui, Add, Picture, vLayoutMap +Border, % "HBITMAP:*" hBitmap ;Show as picture control
Gui, Show
Return