Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 10
Default Problem increasing .PlotArea.Height value

Hello,

I do have some vba code that draws a chart and that resizes the chart so
that it fits exactly to predefined (width and length) values. I do have an
issue with the following code:

Do While .PlotArea.InsideHeight < 496
.PlotArea.Height = .PlotArea.Height + 1
Loop

Since I can't set .PlotArea.InsideHeight directly, I increase
..PlotArea.height until .PlotArea.InsideHeight reaches the predefined value.
The issue that I am having is the following:

on my developement PC, the code works fine with my default printer (HP
LaserJet 1010). When I run the code on a different PC (using a Xerox
printer) the loop, keeps looping, and .PlotArea.Height remains at some value
and does not increase even if it keeps executing the increment line. On this
same PC, if I change the default printer to a HP LaserJet 4L, the code works
fine. The default page for both printers is set to A4.

I tried to run the code on yet a different PC, using the same printers, and
there it loops indefinitely regardless of the default printer.

I wonder if someone could tell me which parameter (printers, regional
settings,...) might influence the behavior of this code ?

Any help would be appreciated.

Thanks,

Xavier


  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Problem increasing .PlotArea.Height value

Hi,

Your code will loop if the plotarea.height can not be increased any
futher than 496. This maybe because the chartarea is not large enough to
accommodate it. Add a variable to the loop that checks whether the
plotarea height changes between loops.

Cheers
Andy

Xavier wrote:
Hello,

I do have some vba code that draws a chart and that resizes the chart so
that it fits exactly to predefined (width and length) values. I do have an
issue with the following code:

Do While .PlotArea.InsideHeight < 496
.PlotArea.Height = .PlotArea.Height + 1
Loop

Since I can't set .PlotArea.InsideHeight directly, I increase
.PlotArea.height until .PlotArea.InsideHeight reaches the predefined value.
The issue that I am having is the following:

on my developement PC, the code works fine with my default printer (HP
LaserJet 1010). When I run the code on a different PC (using a Xerox
printer) the loop, keeps looping, and .PlotArea.Height remains at some value
and does not increase even if it keeps executing the increment line. On this
same PC, if I change the default printer to a HP LaserJet 4L, the code works
fine. The default page for both printers is set to A4.

I tried to run the code on yet a different PC, using the same printers, and
there it loops indefinitely regardless of the default printer.

I wonder if someone could tell me which parameter (printers, regional
settings,...) might influence the behavior of this code ?

Any help would be appreciated.

Thanks,

Xavier



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 10
Default Problem increasing .PlotArea.Height value

Hi Andy,

the code you suggest is what allowed me to pinpoint the erratic behavior
(didn't want to copy too much code in order to remain as clear as possible).
I'll follow your suggestion and have a look at the chartarea. Do you know
how does the chartarea relates to the default printer (or regional settings,
or ???) ?

Thanks for your help,

Xavier


"Andy Pope" wrote in message
...
Hi,

Your code will loop if the plotarea.height can not be increased any futher
than 496. This maybe because the chartarea is not large enough to
accommodate it. Add a variable to the loop that checks whether the
plotarea height changes between loops.

Cheers
Andy

Xavier wrote:
Hello,

I do have some vba code that draws a chart and that resizes the chart so
that it fits exactly to predefined (width and length) values. I do have
an issue with the following code:

Do While .PlotArea.InsideHeight < 496
.PlotArea.Height = .PlotArea.Height + 1
Loop

Since I can't set .PlotArea.InsideHeight directly, I increase
.PlotArea.height until .PlotArea.InsideHeight reaches the predefined
value. The issue that I am having is the following:

on my developement PC, the code works fine with my default printer (HP
LaserJet 1010). When I run the code on a different PC (using a Xerox
printer) the loop, keeps looping, and .PlotArea.Height remains at some
value and does not increase even if it keeps executing the increment
line. On this same PC, if I change the default printer to a HP LaserJet
4L, the code works fine. The default page for both printers is set to A4.

I tried to run the code on yet a different PC, using the same printers,
and there it loops indefinitely regardless of the default printer.

I wonder if someone could tell me which parameter (printers, regional
settings,...) might influence the behavior of this code ?

Any help would be appreciated.

Thanks,

Xavier


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info



  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 10
Default Problem increasing .PlotArea.Height value

Hello Andy,

following your advise, I checked my code for whatever might influence the
behavior of the chartarea. I found out that I was incorrectly setting
margins in my code. The effect of this was not noticeable on my default
printer, but well on some other brands/models.

I rewrote my code using things like ".BottomMargin =
Application.CentimetersToPoints(0.5)" and everything works as expected now.

Thanks again for the hint !

Xavier


"Xavier" wrote in message
...
Hi Andy,

the code you suggest is what allowed me to pinpoint the erratic behavior
(didn't want to copy too much code in order to remain as clear as
possible). I'll follow your suggestion and have a look at the chartarea.
Do you know how does the chartarea relates to the default printer (or
regional settings, or ???) ?

Thanks for your help,

Xavier


"Andy Pope" wrote in message
...
Hi,

Your code will loop if the plotarea.height can not be increased any
futher than 496. This maybe because the chartarea is not large enough to
accommodate it. Add a variable to the loop that checks whether the
plotarea height changes between loops.

Cheers
Andy

Xavier wrote:
Hello,

I do have some vba code that draws a chart and that resizes the chart so
that it fits exactly to predefined (width and length) values. I do have
an issue with the following code:

Do While .PlotArea.InsideHeight < 496
.PlotArea.Height = .PlotArea.Height + 1
Loop

Since I can't set .PlotArea.InsideHeight directly, I increase
.PlotArea.height until .PlotArea.InsideHeight reaches the predefined
value. The issue that I am having is the following:

on my developement PC, the code works fine with my default printer (HP
LaserJet 1010). When I run the code on a different PC (using a Xerox
printer) the loop, keeps looping, and .PlotArea.Height remains at some
value and does not increase even if it keeps executing the increment
line. On this same PC, if I change the default printer to a HP LaserJet
4L, the code works fine. The default page for both printers is set to
A4.

I tried to run the code on yet a different PC, using the same printers,
and there it loops indefinitely regardless of the default printer.

I wonder if someone could tell me which parameter (printers, regional
settings,...) might influence the behavior of this code ?

Any help would be appreciated.

Thanks,

Xavier


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info





  #5   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Problem increasing .PlotArea.Height value

Hi,

Glad you got it sorted.
And thanks for taking the time to post back with your update.

Cheers
Andy

Xavier wrote:
Hello Andy,

following your advise, I checked my code for whatever might influence the
behavior of the chartarea. I found out that I was incorrectly setting
margins in my code. The effect of this was not noticeable on my default
printer, but well on some other brands/models.

I rewrote my code using things like ".BottomMargin =
Application.CentimetersToPoints(0.5)" and everything works as expected now.

Thanks again for the hint !

Xavier


"Xavier" wrote in message
...

Hi Andy,

the code you suggest is what allowed me to pinpoint the erratic behavior
(didn't want to copy too much code in order to remain as clear as
possible). I'll follow your suggestion and have a look at the chartarea.
Do you know how does the chartarea relates to the default printer (or
regional settings, or ???) ?

Thanks for your help,

Xavier


"Andy Pope" wrote in message
...

Hi,

Your code will loop if the plotarea.height can not be increased any
futher than 496. This maybe because the chartarea is not large enough to
accommodate it. Add a variable to the loop that checks whether the
plotarea height changes between loops.

Cheers
Andy

Xavier wrote:

Hello,

I do have some vba code that draws a chart and that resizes the chart so
that it fits exactly to predefined (width and length) values. I do have
an issue with the following code:

Do While .PlotArea.InsideHeight < 496
.PlotArea.Height = .PlotArea.Height + 1
Loop

Since I can't set .PlotArea.InsideHeight directly, I increase
.PlotArea.height until .PlotArea.InsideHeight reaches the predefined
value. The issue that I am having is the following:

on my developement PC, the code works fine with my default printer (HP
LaserJet 1010). When I run the code on a different PC (using a Xerox
printer) the loop, keeps looping, and .PlotArea.Height remains at some
value and does not increase even if it keeps executing the increment
line. On this same PC, if I change the default printer to a HP LaserJet
4L, the code works fine. The default page for both printers is set to
A4.

I tried to run the code on yet a different PC, using the same printers,
and there it loops indefinitely regardless of the default printer.

I wonder if someone could tell me which parameter (printers, regional
settings,...) might influence the behavior of this code ?

Any help would be appreciated.

Thanks,

Xavier

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info






--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
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
have some problem with database baldamenti Excel Discussion (Misc queries) 1 October 13th 05 05:38 PM
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
Problem With Reference Update Egon Excel Worksheet Functions 17 July 16th 05 05:45 AM
Copy an Drag cell Formula Problem Nat Excel Discussion (Misc queries) 1 June 20th 05 03:24 PM
Freeze Pane problem in shared workbooks JM Excel Discussion (Misc queries) 1 February 1st 05 12:04 AM


All times are GMT +1. The time now is 09:18 PM.

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"