ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PrintPreview in I.E. ??? (https://www.excelbanter.com/excel-programming/410196-re-printpreview-i-e.html)

Brad Stone[_2_]

PrintPreview in I.E. ???
 
I just noticed that IE7's Print Preview option works fine most of the time.
But if I have an XLS file loaded into IE7 then the Print Preview option is
grayed! So I'm sure that's why my command button on my XLS file with the
..PrintPreview statement is bombing. Some of my users like viewing XLS files in
IE7 (for some reason) ... otherwise I would tell them to save the XLS file on
their computer and then launch Excel to view it.

Anyone know why my IE7's Print Preview option is disabled any time IE7 views
any XLS file??

Thanks,
Brad



Mark Ivey wrote:

I had a similar problem recently...

Try to fire the macro from IE manually using the TOOLS | MACRO | MACROS...
and see if it will work at all.

In my situation, I was able to run it manually but the button I had on the
worksheet would not work while I had it open in IE.

If there is a solution to this issue, I have not found it yet. I think it
may have something to do with IE's security settings, but I have not put my
finger on it yet.

Mark Ivey

"Brad Stone" wrote in message
...
Hi there,

I'm using Excel 2003. I have a worksheet with a button on it that
does a PrintPreview. The button works fine in the Excel 2003
environment. But when a user loads my .XLS into Internet Explorer (I
assume IE automates Excel) the button fails and gives an error like:
Run-time error: 1004 Method 'PrintPreview' of object 'Sheets' failed

The code behind my button looks like:
ActiveWindow.SelectedSheets.PrintPreview

But I have also tried:
ThisWorkbook.Worksheets("Sheet1").Activate
ThisWorkbook.Worksheets("Sheet1").PrintPreview

They both work in the Excel 2003 environment but both fail if the .XLS
is run from Internet Explorer. My users really like using I.E. to open
XLS files in, so any workaround is creately appreciated!

Thanks,
Brad




All times are GMT +1. The time now is 10:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com