shape remains selected

H

Henk

Based upon user selections, I delete and copy in flags and logo's in a chart.
Somehow, in some charts, the shape I copied in remains selected. This is
really no problem in Excel 2003 running under Vista, neither in Excel 2007
running under Vista, but it is in Excel 2007 running under XP. Charts become
totaly corrupted and unpresentable. Code used :

ActiveSheet.ChartObjects("Graph02Base").Activate
ActiveChart.ChartArea.Select

ActiveChart.Shapes(LogoOld).Select
Selection.Delete

Sheets("Data availability").Shapes(LogoNew).Copy
ActiveSheet.ChartObjects("Graph02Base").Select
ActiveChart.Paste
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
Windows("FileName.xls").Activate
Range("A1").Select

When I select the ChartArea after running the code, I see that the LogoNew
is selected. When I select a title in the graph, the LogoNew becomes
unselected, but then the title remains selected. The only way to get rid of
it is delete the LogoNew and Undo afterwards (but I can not find VB code to
reproduce this).

Question is : How do I Unselect a shape on a Chart?
 
S

Simon Lloyd

Does this work for you



VBA Code:
--------------------



ActiveSheet.ChartObjects("Graph02Base").Activat
ActiveChart.ChartArea.Selec

ActiveChart.Shapes(LogoOld).Selec
Selection.Delet

Sheets("Data availability").Shapes(LogoNew).Cop
ActiveSheet.ChartObjects("Graph02Base").Selec
ActiveChart.Past
Application.CutCopyMode=Fals
ActiveChart.ChartArea.Selec
ActiveWindow.Visible = Fals
Windows("FileName.xls").Activat
Range("A1").Selec

--------------------





Based upon user selections, I delete and copy in flags and logo's in
chart
Somehow, in some charts, the shape I copied in remains selected. Thi
i
really no problem in Excel 2003 running under Vista, neither in Exce
200
running under Vista, but it is in Excel 2007 running under XP. Chart
becom
totaly corrupted and unpresentable. Code used

ActiveSheet.ChartObjects("Graph02Base").Activat
ActiveChart.ChartArea.Selec

ActiveChart.Shapes(LogoOld).Selec
Selection.Delet

Sheets("Data availability").Shapes(LogoNew).Cop
ActiveSheet.ChartObjects("Graph02Base").Selec
ActiveChart.Past
ActiveChart.ChartArea.Selec
ActiveWindow.Visible = Fals
Windows("FileName.xls").Activat
Range("A1").Selec

When I select the ChartArea after running the code, I see that th
LogoNe
is selected. When I select a title in the graph, the LogoNew become
unselected, but then the title remains selected. The only way to ge
rid o
it is delete the LogoNew and Undo afterwards (but I can not find V
code t
reproduce this)

Question is : How do I Unselect a shape on a Chart?


--
Simon Lloyd

Regards
Simon Lloy
'Microsoft Office Help' (http://www.thecodecage.com)
 
H

Henk

Simon,

No, it does not.

tHenks

Simon Lloyd said:
Does this work for you?
VBA Code:
ActiveSheet.ChartObjects("Graph02Base").Activate
ActiveChart.ChartArea.Select

ActiveChart.Shapes(LogoOld).Select
Selection.Delete

Sheets("Data availability").Shapes(LogoNew).Copy
ActiveSheet.ChartObjects("Graph02Base").Select
ActiveChart.Paste
Application.CutCopyMode=False
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
Windows("FileName.xls").Activate
Range("A1").Select
Based upon user selections, I delete and copy in flags and logo's in a
chart.
Somehow, in some charts, the shape I copied in remains selected. This
is
really no problem in Excel 2003 running under Vista, neither in Excel
2007
running under Vista, but it is in Excel 2007 running under XP. Charts
become
totaly corrupted and unpresentable. Code used :

ActiveSheet.ChartObjects("Graph02Base").Activate
ActiveChart.ChartArea.Select

ActiveChart.Shapes(LogoOld).Select
Selection.Delete

Sheets("Data availability").Shapes(LogoNew).Copy
ActiveSheet.ChartObjects("Graph02Base").Select
ActiveChart.Paste
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
Windows("FileName.xls").Activate
Range("A1").Select

When I select the ChartArea after running the code, I see that the
LogoNew
is selected. When I select a title in the graph, the LogoNew becomes
unselected, but then the title remains selected. The only way to get
rid of
it is delete the LogoNew and Undo afterwards (but I can not find VB
code to
reproduce this).

Question is : How do I Unselect a shape on a Chart?r


--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=180020

Microsoft Office Help

.
 
S

Simon Lloyd

Maybe then you could use


VBA Code:
--------------------


ActiveChart.Deselect
--------------------



Instead of (or aswell as)


VBA Code:
--------------------


Application.CutCopyMode=False
--------------------




Simon

No, it does not

tHenk


Does this work for you



VBA Code
-------------------





Sheets("Data availability").Shapes(LogoNew).Cop
ActiveSheet.ChartObjects("Graph02Base").Selec
ActiveChart.Past
Application.CutCopyMode=Fals
ActiveChart.ChartArea.Selec
ActiveWindow.Visible = Fals
Windows("FileName.xls").Activat
Range("A1").Selec

-------------------






Henk;645900 Wrote
Based upon user selections, I delete and copy in flags and logo's i
chart
Somehow, in some charts, the shape I copied in remains selected. Thi
i
really no problem in Excel 2003 running under Vista, neither in Exce
200
running under Vista, but it is in Excel 2007 running under XP. Chart
becom
totaly corrupted and unpresentable. Code used


Sheets("Data availability").Shapes(LogoNew).Cop
ActiveSheet.ChartObjects("Graph02Base").Selec
ActiveChart.Past
ActiveChart.ChartArea.Selec
ActiveWindow.Visible = Fals
Windows("FileName.xls").Activat
Range("A1").Selec
When I select the ChartArea after running the code, I see that th
LogoNe
is selected. When I select a title in the graph, the LogoNew become
unselected, but then the title remains selected. The only way to ge
rid o
it is delete the LogoNew and Undo afterwards (but I can not find V
code t
reproduce this)
Question is : How do I Unselect a shape on a Chart?

-
Simon Lloy
Regards
Simon Lloy
'Microsoft Office Help' ('The Code Cage - Microsoft Office Help
Microsoft Office Discussion' (http://www.thecodecage.com)

-----------------------------------------------------------------------
Simon Lloyd's Profile:
View this thread: 'shape remains selected - The Code Cage Forums (http://www.thecodecage.com/forumz/showthread.php?t=180020

'Microsoft Office Help' (http://www.thecodecage.com


--
Simon Lloyd

Regards
Simon Lloy
'Microsoft Office Help' (http://www.thecodecage.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top