Quantcast
Channel: General Office Development forum
Viewing all articles
Browse latest Browse all 2257

Unable to edit Excel data after updating/closing PowerPoint file with VBA

$
0
0

Hello,

I have created an Excel add-in which opens a PPT template, updates a few charts and tables and saves.  There is a chart that once it's updated, it cannot be edited.  Clicking on Edit data in Excel does not open the excel file - no error message, nothing happens. 

Also, while the PPT file is still open, you are able to edit the excel data in the tables, however, once you close and re-open the file, and edit the table, all data that was added via the macro is wiped out from the table. 

Any idea what could be causing these issue and/or how to correct them?

Any help is much appreciated!

Here's the code to update the chart:

'UPDATE PI CHART
    Set PPSlide = PPPres.Slides(5)
    With PPSlide.Shapes("Chrt_PurchaseIntent").Chart.ChartData
        With .Workbook.Sheets(1)
        .Activate
            Counter = 0
            For Each Cpt In CptNameRng
                Counter = 1 + Counter
                .Cells(Counter + 1, 1).Value = ConceptNameArray(Counter) 'concept name
                .Cells(Counter + 1, 2).Value = Cpt.Offset(0, 4) 'top box
                .Cells(Counter + 1, 3).Value = Cpt.Offset(0, 5) 'top 2 box
                'Add benchmark star if benchmark concept
                If IsInArray(ConceptNameArray(Counter), BenchmarkArray) = True Then
                    .Cells(Counter + 1, 6) = "-4%"
                Else
                    .Cells(Counter + 1, 6) = ""
                End If
                If Counter = NumOfCpts Then
                    'TB Average
                    TBPI = Cpt.Offset(2, 4).Value
                    .Range("D1") = "Database Top Box (" & Format(TBPI, "0%") & ")"
                    .Range("D2:D" & NumOfCpts + 1) = TBPI
                    'T2B Average
                    T2BPI = Cpt.Offset(2, 5).Value
                    .Range("E1") = "Database Top 2 Box (" & Format(T2BPI, "0%") & ")"
                    .Range("E2:E" & NumOfCpts + 1) = T2BPI
                End If
            Next Cpt
'            'sort on T2B
'            Set ChrtDataRng = .Range("A2:F" & .Range("A1").End(xlDown).Row)
'            ChrtDataRng.Sort Key1:=ChrtDataRng(2, 3), Order1:=xlDescending, DataOption1:=xlSortNormal, Header:=xlYes
        End With
        .Workbook.Close
    End With

Thanks!


Viewing all articles
Browse latest Browse all 2257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>