Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default spreadsheet on userform

Hi guys, maybe you can help me with this.

I have a spreadsheet on a userform. When I try Printform, the form get
printed OK, but the spreadsheet on it comes out reduced so much tha
it's illegible.
This is the script I'm using;


code:
--------------------------------------------------------------------------------

Sub print_savings()
Dim prl As Long, prh As Long
prl = UserForm11.Spreadsheet1.Range("A500").End(xlUp).Ro w
prh = UserForm11.Spreadsheet1.Range("A1:A" & prl).Height
UserForm11.Height = prh + 488
UserForm11.Image1.Height = prh
UserForm11.Spreadsheet1.Height = prh

UserForm11.Spreadsheet1.ActiveWindow.EnableResize = True
UserForm11.Spreadsheet1.Height = prh
UserForm11.PrintForm
End Sub

--------------------------------------------------------------------------------





Any ideas

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default spreadsheet on userform

Hi "alcorjr"; you can try this:

Private Sub CmdPrint_Click()
Me.Repaint
Const Wbk = "c:\Mes Documents\MyTest.xls" ' for example !
Me.Spreadsheet1.Export Wbk, ssExportActionNone, ssExportAsAppropriate
Dim oXL As Object, wBook As Object
Set oXL = CreateObject("Excel.Application")
Set wBook = oXL.Workbooks.Open(Wbk)
wBook.Sheets(1).PrintOut Copies:=1
wBook.Close False
Kill Wbk
oXL.Quit
Set wBook = Nothing: Set oXL = Nothing
End Sub

"alcorjr" a écrit dans le message de
...
Hi guys, maybe you can help me with this.

I have a spreadsheet on a userform. When I try Printform, the form gets
printed OK, but the spreadsheet on it comes out reduced so much that
it's illegible.
This is the script I'm using;


code:
--------------------------------------------------------------------------------

Sub print_savings()
Dim prl As Long, prh As Long
prl = UserForm11.Spreadsheet1.Range("A500").End(xlUp).Ro w
prh = UserForm11.Spreadsheet1.Range("A1:A" & prl).Height
UserForm11.Height = prh + 488
UserForm11.Image1.Height = prh
UserForm11.Spreadsheet1.Height = prh

UserForm11.Spreadsheet1.ActiveWindow.EnableResize = True
UserForm11.Spreadsheet1.Height = prh
UserForm11.PrintForm
End Sub

--------------------------------------------------------------------------------





Any ideas?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default spreadsheet on userform

Michel, thanks for your quick reply, but in the end I decided that,
since I didn't really need to use the special features provided by the
spreadsheet, I took the easy way out and substitued it for a
Listbox.

I'll save your code for future use, though.

Cheers, and Merry Xmas!!!:p


---
Message posted from http://www.ExcelForum.com/

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
UserForm Data to Spreadsheet Andy Tallent Excel Discussion (Misc queries) 2 June 22nd 05 04:51 PM
userform for spreadsheet spreadsheets/userforms Excel Discussion (Misc queries) 1 May 20th 05 12:18 PM
Bringing info from userform to spreadsheet David Excel Programming 3 December 8th 03 03:09 AM
Can I program a userform via spreadsheet? Phillips Excel Programming 2 November 27th 03 04:11 AM
Spreadsheet in an Userform Lukas Rüttimann Excel Programming 0 September 23rd 03 05:06 PM


All times are GMT +1. The time now is 07:17 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"