I am automating Excel 2003 and trying to remove the default vertical page
break, when I try to delete it I get an error, I can delete a page break
that I added though.

So since I cannot remove the pagebreak I tried to move it to the column I
want it at using VPageBreaks(1).Location this does not work.

Could someone explain how to get the page break where I want it.

I have searched Google and the examples I have seen all adding pagebreaks
and not moving.

Every one have a great New Year

Thanks
Tom

RE: Excel Automation by Allan

Allan
Sat Dec 29 01:04:01 CST 2007

hi tom,

the default pagebreak uses the current page setup, e. i. paper size,
margins, scaling, etc... when adding a vertical page break, it will still
observe the page-setup, whichever is shorter between your page break and the
paper size...

fyi,

allan



"Tom Libby" wrote:

> I am automating Excel 2003 and trying to remove the default vertical page
> break, when I try to delete it I get an error, I can delete a page break
> that I added though.
>
> So since I cannot remove the pagebreak I tried to move it to the column I
> want it at using VPageBreaks(1).Location this does not work.
>
> Could someone explain how to get the page break where I want it.
>
> I have searched Google and the examples I have seen all adding pagebreaks
> and not moving.
>
> Every one have a great New Year
>
> Thanks
> Tom
>
>
>
>
>

Re: Excel Automation by Tom

Tom
Wed Jan 02 08:35:00 CST 2008

Thanks Allan,

I am trying to set the page break like is done using print preview and
manually setting page breaks. The user wants the Excel file to automatically
print after it is created and we want all the columns to fit on one page.

Tom

"Allan" <Allan@discussions.microsoft.com> wrote in message
news:E3057A08-3755-4DCC-B08A-00AD536B328D@microsoft.com...
> hi tom,
>
> the default pagebreak uses the current page setup, e. i. paper size,
> margins, scaling, etc... when adding a vertical page break, it will still
> observe the page-setup, whichever is shorter between your page break and
> the
> paper size...
>
> fyi,
>
> allan
>
>
>
> "Tom Libby" wrote:
>
>> I am automating Excel 2003 and trying to remove the default vertical page
>> break, when I try to delete it I get an error, I can delete a page break
>> that I added though.
>>
>> So since I cannot remove the pagebreak I tried to move it to the column I
>> want it at using VPageBreaks(1).Location this does not work.
>>
>> Could someone explain how to get the page break where I want it.
>>
>> I have searched Google and the examples I have seen all adding pagebreaks
>> and not moving.
>>
>> Every one have a great New Year
>>
>> Thanks
>> Tom
>>
>>
>>
>>
>>



Re: Excel Automation by Stefan

Stefan
Wed Jan 02 09:13:26 CST 2008


"Tom Libby" <tlibby@bigblue-usa.com> schrieb im Newsbeitrag
news:%233z4oyUTIHA.4696@TK2MSFTNGP05.phx.gbl...
> Thanks Allan,
>
> I am trying to set the page break like is done using print preview and
> manually setting page breaks. The user wants the Excel file to
> automatically print after it is created and we want all the columns to fit
> on one page.

Is the Excel "Macro Recorder" able to log some VBA code when
you insert the page breaks manually?


hth
-Stefan



--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------



Re: Excel Automation by Tom

Tom
Wed Jan 02 09:29:05 CST 2008

Yes, that is what I had used to figure out the code but that does not work
when I convert the code to VFP. The macro used DragOff but that did not
work. Looking through the docs it states that DragOff is for the Macro
recorder.


"Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
news:OHJ6LIVTIHA.1212@TK2MSFTNGP05.phx.gbl...
>
> "Tom Libby" <tlibby@bigblue-usa.com> schrieb im Newsbeitrag
> news:%233z4oyUTIHA.4696@TK2MSFTNGP05.phx.gbl...
>> Thanks Allan,
>>
>> I am trying to set the page break like is done using print preview and
>> manually setting page breaks. The user wants the Excel file to
>> automatically print after it is created and we want all the columns to
>> fit on one page.
>
> Is the Excel "Macro Recorder" able to log some VBA code when
> you insert the page breaks manually?
>
>
> hth
> -Stefan
>
>
>
> --
> |\_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
>



Re: Excel Automation by Tom

Tom
Thu Jan 03 08:54:55 CST 2008

In case anyone is interested I resolved this by setting the PageSetup.Zoom =
90, I was not able to remove the page break but setting the Zoom to 90 put
the page break where I wanted it.

Tom


"Tom Libby" <tlibby@bigblue-usa.com> wrote in message
news:uTKMv8YSIHA.4584@TK2MSFTNGP03.phx.gbl...
>I am automating Excel 2003 and trying to remove the default vertical page
>break, when I try to delete it I get an error, I can delete a page break
>that I added though.
>
> So since I cannot remove the pagebreak I tried to move it to the column I
> want it at using VPageBreaks(1).Location this does not work.
>
> Could someone explain how to get the page break where I want it.
>
> I have searched Google and the examples I have seen all adding pagebreaks
> and not moving.
>
> Every one have a great New Year
>
> Thanks
> Tom
>
>
>
>



Re: Excel Automation by Bernhard

Bernhard
Mon Jan 07 02:59:33 CST 2008

Hi Tom,

> In case anyone is interested I resolved this by setting the PageSetup.Zoom =
> 90, I was not able to remove the page break but setting the Zoom to 90 put
> the page break where I wanted it.
Maybe you set
PageSetup.Zoom = false
and use
PageSetup.FitToPagesWide / .FitToPagesTall
see Excel VBA Help for more info.

Regards
Bernhard Sander