PrintPreview in I.E. ???

B

Brad Stone

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
 
M

Mark Ivey

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
 
B

Brad Stone

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top