BleepingComputer.com: print preview greyed out when printing from userform

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

print preview greyed out when printing from userform written Excel 2003, running Excel 2007

#1 User is offline   XML2005 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 57
  • Joined: 26-August 05
  • Gender:Male

Posted 24 September 2009 - 09:04 PM

I wrote an application in Excel 2003. When document opens, a userform is displayed. User inputs data which gets formatted to a spreadsheet to be previewed and printed. User never types directly on the spreadsheet.

In Excel 2003, it worked fine. But when I try to run my .xls file in Excel 2007, the print preview buttons are greyed out.

Here's my code, after the spreadsheet has been formatted.

Sheets(1).Activate
Sheets(1).Unprotect Password:="mypassword"
Application.ScreenUpdating = True
form1.Hide
ActiveWindow.SelectedSheets.PrintPreview
' At this point, user sees Print Preview, but unfortunately cannot print the data!!!
Sheets(1).Protect userinterfaceonly:=True, Password:="mypassword"
form1.Show vbModal

Anyone ever see this problem before? Thanks for your help.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users