Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Getting unnecessary 2nd Page

Maybe...
right after:
ActiveSheet.Range("A1").Select
add this:
With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

(Untested)



Jim May wrote:

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


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default Getting unnecessary 2nd Page

Dave - That was it !! Much appreciated..
another quicky.. has befallen me.. Sometimes (& now is one of those times)
in my Code sheet - my cursor instead of showing the cross-hair symbol - it
becomes a black square the size of a character. I usually look around to see
if I have mistakenlt touched a key, like the scroll-lock, whatever, but no
joy..

Is there someting that this usualy points to that I can fix?

Thanks,

Jim May


"Dave Peterson" wrote:

Maybe...
right after:
ActiveSheet.Range("A1").Select
add this:
With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

(Untested)



Jim May wrote:

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


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default Getting unnecessary 2nd Page

Never mind - it is the INSERT key --- grrrr

"Dave Peterson" wrote:

Maybe...
right after:
ActiveSheet.Range("A1").Select
add this:
With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

(Untested)



Jim May wrote:

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


--

Dave Peterson

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
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 11:59 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"