LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default Getting unnecessary 2nd Page

I found the following code by Tom Oglivy on Google and have applied into my
app.
Just ran it for the first time and it is GREAT, except a second page is
being produced with just a reminent (the width of the top-right "X" box
(displayed) down my page 2 ) about 1/8th of an inch wide and 6 inches tall.
How can I eliminate
this residue so that only one page <<Page 1 is Perfect as is It's just
that the
last 1/8th inch of my Page 1 is repeating onto Page 2.


'In a General Module enter:
Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Public Const VK_SNAPSHOT = 44
Public Const VK_LMENU = 164
Public Const KEYEVENTF_KEYUP = 2
Public Const KEYEVENTF_EXTENDEDKEY = 1

In the userform module:
Private Sub CommandButton1_Click()
' keybd_event VK_SNAPSHOT, 0, 0, 0
DoEvents
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
DoEvents
Workbooks.Add
Application.Wait Now + TimeValue("00:00:01")
ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False,
DisplayAsIcon:=False
ActiveSheet.Range("A1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWorkbook.Close False
End Sub

Thanks in advance for any assistance...

Jim May
 
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
Unnecessary Space Elton Law[_2_] Excel Worksheet Functions 2 February 19th 10 11:28 AM
Delete Unnecessary Rows Steve Excel Discussion (Misc queries) 1 May 28th 08 01:23 AM
Unnecessary conversion Stefi Excel Discussion (Misc queries) 2 January 16th 07 03:03 PM
How do I remove unnecessary vertical page break? 1smstewart1 Excel Worksheet Functions 2 November 15th 06 06:09 PM
Using an XLT file which prints unnecessary 2nd page Joni New Users to Excel 2 March 20th 05 05:21 PM


All times are GMT +1. The time now is 08:38 AM.

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

About Us

"It's about Microsoft Excel"