0

I am creating a OLEobject from other application (NX Cad) in a power point. After Creation of the powerpoint I am unable to edit the values of the Sheet I created. It is Vanishing and showing only Sheet1 with No values. How to update or fix this.

         Try
            Dim objPPTShape As Object = Nothing
            objPPTShape = ActiveSlide.Shapes.AddOLEObject(Left:=490,Top:=60, Width:=220, Height:=420, ClassName:="Excel.Sheet", DisplayAsIcon:=False, Link:=False)

            Dim Mysheet As Object = Nothing
            Mysheet = objPPTShape.OLEFormat.Object.Worksheets.add()
            Mysheet.Name() = "NX Update"

            With Mysheet

                .Cells(1, 1).value = "XXX"

               .Cells(13, 2).value = "XXXX"

                'Format the Excel table
                With .Range(.Cells(1, 1), .Cells(13, 2))
                    .Borders.Weight = 1
                    .Font.Name = "Times New Roamn"
                    .Font.Bold = False
                    .Font.Size = 12
                    .RowHeight = 20
                    .ColumnWidth = 30
                End With

                'Title Block
                With .Range(.Cells(1, 1), .Cells(1, 2))
                    .Font.Bold = True
                    .Font.Size = 14
                End With

            End With

        Catch ex As Exception
            lw.WriteLine(ex.Message.ToString)
        End Try
Community
  • 1
  • 1
Joe
  • 1
  • 1
  • It is happening only I closes the power point with code 'ActivePresentation.Save() ActivePresentation.Close() AppPowerPoint.Quit() AppPowerPoint = Nothing ActivePresentation = Nothing ActiveSlide = Nothing' – Joe Mar 01 '17 at 06:51
  • You might want to edit your tags to reflect the language better; your example code is not entirely VBA; there's no Try/Catch in VBA. But try invoking Update on the OLE object before saving/closing PowerPoint. – Steve Rindsberg Mar 01 '17 at 17:52

0 Answers0