Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Plot Area Automatically Expands in Print and Print Preview | Charts and Charting in Excel | |||
First page of Excel sheerepeats in print layout or print preview | Excel Discussion (Misc queries) | |||
Print and Print Preview Graphic Moving Resizing 2007/2003 | Excel Discussion (Misc queries) | |||
print preview v page break preview | Excel Discussion (Misc queries) | |||
cell borders that I create dont show on print preview or print | Excel Discussion (Misc queries) |