Excel Window Popping Up while Adding Chart in PowerPoint

Posted by Naimishforu under VB.NET on 2/9/2011 | Points: 10 | Views : 2545 | Status : [Member] [MVP] | Replies : 6
Hi Frds,

Can someone please help me into this?

I'm executing below code from my application,

chart = slide.Shapes.AddChart(XlChartType.xlLineMarkers, shapeLeft, shapeTop, shapeWidth, shapeHeight).Chart


Once this line gets execute, it's poping-up Excel window....I don't want to let the excel window pop-up.

Any idea please??

Thanks

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/



Responses

Posted by: Karthikanbarasan on: 2/9/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Please post the complete code!!!

Thanks
Karthik
www.f5Debug.net

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/9/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Private Function SetSlideCharts(ByVal slide As PowerPoint.Slide, ByVal graphID As String, ByVal setData As Action(Of PowerPoint.Chart)) As PowerPoint.Chart


Dim chart As PowerPoint.Chart = Nothing
Dim dataLables As PowerPoint.DataLabels
Dim objAxes As PowerPoint.Axes
Dim objSeriesCollection As PowerPoint.SeriesCollection
Dim objSeries As PowerPoint.Series = Nothing
Dim objapp As Excel.Workbook = Nothing

Dim shapeHeight, shapeWidth, shapeTop, shapeLeft As Single
'get the shape object that need to be substituted with graph
Dim shape = slide.Shapes.FindShape(graphID)
If shape Is Nothing Then Return Nothing

shapeHeight = shape.Height
shapeWidth = shape.Width
shapeTop = shape.Top
shapeLeft = shape.Left

shape.Delete()

chart = slide.Shapes.AddChart(XlChartType.xlLineMarkers, shapeLeft, shapeTop, shapeWidth, shapeHeight).Chart

With (chart)
.Legend.Position = PowerPoint.XlLegendPosition.xlLegendPositionBottom
.Legend.Format.TextFrame2.TextRange.Font.Size = 8

'cast and get the Axes of the chart
objAxes = DirectCast(.Axes, PowerPoint.Axes)
objAxes.Item(PowerPoint.XlAxisType.xlValue).HasMajorGridlines = False
objAxes.Item(PowerPoint.XlAxisType.xlCategory).TickLabels.Font.Size = 8
objAxes.Item(PowerPoint.XlAxisType.xlValue).TickLabels.Font.Size = 8
objAxes.Item(PowerPoint.XlAxisType.xlCategory).TickLabels.Orientation = PowerPoint.XlTickLabelOrientation.xlTickLabelOrientationUpward
End With

End Sub


Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/9/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Thanks for posting... ill check the same!!!

Thanks
Karthik
www.f5Debug.net

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/9/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Yup Thanks,

It's been long time I'm wrking on the same.

Appreciate your help.

Thanks

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/9/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Sure Naimishforu... will try my best!!!

Thanks
Karthik
www.f5Debug.net

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 6/29/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
@Karthik,

Any luck man??

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response