Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Print Preview hangs

Hi all

When I run this code:

Dim MWB As Workbook
Dim Sht As Worksheet
Set MWB = Workbooks.Open("c:\Development\AtRisk Excel
Project\MigrationReport.xls")
Set Sht = MWB.Sheets("FirstMigration")
Sht.PrintPreview

The preview opens behind my VBA form, but then everything hangs. I have to
use task manager to terminate excel. Printing without previewing works fine.
OS is Windows 2000.

Any idreas?


  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default Print Preview hangs

James,

You need to Hide the userform prior to calling PrintPreview, and the Show
the form when PrintPreview returns. E.g.,

Set Sht = MWB.Sheets("FirstMigration")
Me.Hide '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Sht.PrintPreview
Me.Show ' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com


"James Cooke" wrote in message
...
Hi all

When I run this code:

Dim MWB As Workbook
Dim Sht As Worksheet
Set MWB = Workbooks.Open("c:\Development\AtRisk Excel
Project\MigrationReport.xls")
Set Sht = MWB.Sheets("FirstMigration")
Sht.PrintPreview

The preview opens behind my VBA form, but then everything hangs. I have to
use task manager to terminate excel. Printing without previewing works

fine.
OS is Windows 2000.

Any idreas?




  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Print Preview hangs

Thank you Chip, this works.
james
"Chip Pearson" wrote in message
...
James,

You need to Hide the userform prior to calling PrintPreview, and the Show
the form when PrintPreview returns. E.g.,

Set Sht = MWB.Sheets("FirstMigration")
Me.Hide '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Sht.PrintPreview
Me.Show ' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com


"James Cooke" wrote in message
...
Hi all

When I run this code:

Dim MWB As Workbook
Dim Sht As Worksheet
Set MWB = Workbooks.Open("c:\Development\AtRisk Excel
Project\MigrationReport.xls")
Set Sht = MWB.Sheets("FirstMigration")
Sht.PrintPreview

The preview opens behind my VBA form, but then everything hangs. I have

to
use task manager to terminate excel. Printing without previewing works

fine.
OS is Windows 2000.

Any idreas?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plot Area Automatically Expands in Print and Print Preview Myk D. Charts and Charting in Excel 2 March 12th 09 01:41 PM
First page of Excel sheerepeats in print layout or print preview philfrotonda Excel Discussion (Misc queries) 1 July 12th 07 09:28 PM
Print and Print Preview Graphic Moving Resizing 2007/2003 Adam Rayburn Excel Discussion (Misc queries) 0 April 4th 07 04:18 PM
print preview v page break preview SamB Excel Discussion (Misc queries) 0 November 16th 06 05:09 PM
cell borders that I create dont show on print preview or print scott3435 Excel Discussion (Misc queries) 2 April 6th 06 02:37 AM


All times are GMT +1. The time now is 06:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"