Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Excel 2007 Not Drawing Correctly

Hi all

I have some code to select shapes grap their top, left positions and then
move shapes to suit. When I run it through excel 2003 it works fine, however
excel 2007 doesn't position them correctly. Has there been any code changes
that I need to be aware of.

Any answers would be greatly appreciated

Jason
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel 2007 Not Drawing Correctly

Nothing I'm aware of that would cause problems with macros that analyze pixel
coordinates. Is it moving the shapes based on hardcoded pixel offsets?
....maybe something to do with screen resolution on different machines rather
than XL2007.

Have you tried testing a simple macro to return top and left pixel values
for a given cell in each version? Usually when I create macros like this, I
look for a specific cell to just use as a key location and then set topleft
values accordingly. Then I don't have to worry about changing column widths
or row heights that could muddle things up.

Any rows or columns hidden or resized on one version vs. the other?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default Excel 2007 Not Drawing Correctly

Jason Zischke wrote:
Hi all

I have some code to select shapes grap their top, left positions and then
move shapes to suit. When I run it through excel 2003 it works fine, however
excel 2007 doesn't position them correctly. Has there been any code changes
that I need to be aware of.

Any answers would be greatly appreciated


Yes some Shapes methods are screwed in XL2007 they gratuitously changed
the convention for specifying some of them from

BeginX, BeginY, XWidth, YWidth

to

BeginX, BeginY, EndX, EndY

Arguably you could say they did it to make the implementation match what
the XL2003 Help file says about eg AddConnector. In XL2007 AddShape
retains the old syntax of topleft, width, height whilst AddConnector
uses beginX, beginY, endX, endY so it is a right mess.

Not surprisingly all existing XL2003 code that uses affected shape
methods requires tedious rework and the codebase has to fork. It looks
particularly funny if some of your shapes have zero width or height.

AddConnector is badly affected whilst some other Shapes operations
remain unmolested if the Help is to be believed (you can't trust it in
any version). You basically have to test the Shapes functionality that
you use and put in work arounds.

Mostly mechanical alterations to parameter lists along the lines of
Bx, By, Wx, Wy becomes Bx, By, Bx+Wx, By+Wy (or vice versa)

A list of all the methods where the help is misleading and the
coordinates are not as described might be a useful resource. I only
tested the ones that were used in my software.

AddConnector changes caused me a lot of grief when XL2007 came out.

Regards,
Martin Brown
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
Drawing objects in Excel 2007 cf1uk Excel Discussion (Misc queries) 1 November 4th 09 02:41 PM
drawing lines in Excel 2007 truenorth Charts and Charting in Excel 1 January 14th 09 05:01 AM
Drawing Lines In Excel 2007 Roadrunner Excel Discussion (Misc queries) 5 July 14th 08 01:18 PM
How can I execute Shape drawing Excel 2007? jabbott Excel Programming 0 June 27th 08 07:55 PM
Excel 2007 macros with drawing objects DMChesser Excel Discussion (Misc queries) 1 October 8th 07 09:05 PM


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