Avatar of MadIce
MadIce asked on

Zorder issue when calling excel shape.

Whats wrong with the second line of code from the following:

oChart.Shapes.Item("Text Box 4").Select()
 oExcel.Application.ActiveWindow.Selection.ShapeRange.ZOrder = Microsoft.Office.Core.MsoZOrderCmd.msoBringToFront
I get a "member not found" error which I believe is for the Zorder.  I want to move a text box on my chart to the front. Thanks in advance
Visual Basic.NETMicrosoft Excel

Avatar of undefined
Last Comment
MadIce

8/22/2022 - Mon
lfcbc75

For a better understanding of your problem, paste here more of your code, or upload your spreadsheet if its possible.
The syntax shown seems to invalid...
byundt

Does it work if you use an explicit value for the Z-order?
 oExcel.Application.ActiveWindow.Selection.ShapeRange.ZOrder = 0        'msoBringToFront = 0
ASKER
MadIce

byundt, I tried using explicit value. same issue.  
lfcbc75, the code is not on the spreadsheet side. Not sure what other code would be useful. There is too much to add but here is some of it.

        Dim oExcel As Excel.Application
        Dim oSheet As Excel.Worksheet
        Dim oWrkBook As Excel.Workbook
        Dim oChart As Excel.Chart
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
byundt

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
MadIce

byundt, That did the trick. Thanks alot. I thought I was going to have to do this a different way.