G
GribFritz
Hey all,
My issue is with a VB program that automatically generates Excel files. If
the user has an instance of Excel open, attempting to close a workbook with a
print preview dialog causes the app to hang. Likewise, I have a call to
GetObject that causes the app to hang when print preview is open:
To prevent these calls from hanging, any instances of Excel with a print
preview window open, need to be closed. Programmatically, I accomplish this
with some API work and automatic button clicking. However, in Excel 2007 ,
this fails due to the ribbon.
The Ribbon appears to be a netuihwnd window. It has no hwnd. The buttons on
the window do not belong to the "button" class (or ANY class as far as I can
tell) so I can't programmatically press them.
Hopefully, some of you gurus can help me as hwnd-less windows with buttons
that aren't really buttons is a bit beyond me. If there is a better way to
close a workbook that is in print preview mode that doesn't cause an app to
hang, I'm all ears. Barring that, any programmatic way to close an Excel 2007
print preview window would be great. Thanks in advance.
Fritz
My issue is with a VB program that automatically generates Excel files. If
the user has an instance of Excel open, attempting to close a workbook with a
print preview dialog causes the app to hang. Likewise, I have a call to
GetObject that causes the app to hang when print preview is open:
To prevent these calls from hanging, any instances of Excel with a print
preview window open, need to be closed. Programmatically, I accomplish this
with some API work and automatic button clicking. However, in Excel 2007 ,
this fails due to the ribbon.
The Ribbon appears to be a netuihwnd window. It has no hwnd. The buttons on
the window do not belong to the "button" class (or ANY class as far as I can
tell) so I can't programmatically press them.
Hopefully, some of you gurus can help me as hwnd-less windows with buttons
that aren't really buttons is a bit beyond me. If there is a better way to
close a workbook that is in print preview mode that doesn't cause an app to
hang, I'm all ears. Barring that, any programmatic way to close an Excel 2007
print preview window would be great. Thanks in advance.
Fritz