Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Office/Excel 2007 and Shapes

  Asked By: Kristopher    Date: Mar 10    Category: MS Office    Views: 913
  

My company is planning to migrate to Office2007 on XP machines.
Thanks to my 40,000 lines of VBA code, I've been given an "Early
Deployment" in order to test my applications.

Now, I've been running Office2007 on my Vista machine at home and
have not seen any problems, but then again, I don't have 40,000 lines
of VBA at home. (I probably do, but it's only used for laying out 3-
table Euchre Tournament Tallies)

At work, in the XP environment, I've come across some things
that have me perplexed. A couple, I'd like to find out if they
happen with others in an XP environment so that I can know it's not
just ME.

1) if Excel is NOT open, and I double-click on an excel file, it
opens an Excel session, but it takes a full minute before the
workbook appears. But if, as soon as the session window appears, I
MINIMIZE it, it immediately reopens with the workbook displayed.
2) The "X" at the top right that normally will close Excel and all
open workbooks, now only closes the active workbook, just like
the "X" below it.

I can work with these "quirks", but
this one REALLY has me stumped:

I have a change event that checks for changes to cells in a specific
set of ranges. If an entry is made, my VBA inserts a "balloon".

I use the flow chart connector symbol, but it works the same with an
oval.
to center the balloon, I determine the cell's top and left side,
width and height, calculate the center and subtract 1/2 the diameter
of the circle to determine the location of the top and left of the
balloon.

Here's the "fun" part. If the sheet is displayed at 100% or MORE, it
works fine. If it is LESS than 100%, then the balloon shifts to the
LEFT (not UP!) an amount inversely proportional to the zoom factor.
Meaning, that if the display is at 25%, the balloon is shifted more
to the left than it is if the display is 75%.

A simplified version of the coding is:

Sub Insert_Balloon()
Dim CurSel, Bal_Left, Bal_Top, Bal_Width, Bal_Height
CurSel = Selection.Address
Bal_Left = Selection.Left + Selection.Width / 2 - 9 ' - 20
Bal_Top = Selection.Top ' - 1
Bal_Top = Selection.Top + Selection.Height / 2 - 9
Bal_Width = 18 'Selection.Width '19
Bal_Height = 18 'Selection.Height '19
ActiveSheet.Shapes.AddShape(msoShapeFlowchartConnector, Bal_Left,
Bal_Top, Bal_Width, Bal_Height).Select
Selection.ShapeRange.Fill.Transparency = 1#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.ForeColor.SchemeColor = 10
Application.StatusBar = ActiveWindow.Zoom

Range(CurSel).Select
End Sub

The cell has a column width of 3 and a height of 15.25
You might want to put a border on it so that you can detect a shift.

I know it works fine in Excel97.
Can anyone tell me how it behaves in Excel2007 on XP or Vista?

(the only discussion on Microsoft's site is with regard to anchoring
shapes in Word tables)

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Office/Excel 2007 and Shapes Or get search suggestion and latest updates.




Tagged: