Microsoft office security

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,059
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
I have this problem and have done the goole as well but no soultion till now, so thought to ask the experts.

I have a excel file with many sheets and that sheet contains charts and tables, theres charts and tables are in the respective ppt slides. I have copyed the chart from excel and pasted as keep source formating and link data(F).

and have saved the ppt file in the same location as the excel file is.

once i open the ppt i get the message (ref screen shot) attached. if i don't click on Update the ppt slides are not getting updated. Not sure as how to disable this alert and autoupdate all the slides.

I have tried trusted source as well, please suggest.

1693418992976.png
 

Attachments

  • 1693418957928.png
    1693418957928.png
    34.3 KB · Views: 4

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
yes i tried this if i say false, it don't update the PPT slides that are link to excel
 
Upvote 0
I am trying to run this code below were it will update the PPT links but it is getting me an error as class not registered error

or any other code so that it updates the ppt.


VBA Code:
Sub updateppt()

Dim objPowerPoint As New PowerPoint.Application
Dim objPresentation As Presentation
Dim oPS As PowerPoint.SlideRange


'ActivePresentation.UpdateLinks

Dim sld As Slide
        Dim shp As Shape
        For Each sld In ActivePresentation.Slides  '' Here is the error
            For Each shp In sld.Shapes
                If shp.Type = msoLinkedOLEObject Then
                    If shp.OLEFormat.progID Like "Excel.*" Then
                        shp.LinkFormat.Update
                        'shp.LinkFormat.BreakLink
                    End If
                End If
            Next shp
        Next sld



End Sub
 
Upvote 0
I want to assist but have never done anything using Power Point. Hopefully others who are more familiar can step up and help..

Best wishes.
 
Upvote 0
Hi to all.
@vmjan02, are you using your macro in post #4 in PPT ? or are you trying to use it in Excel ? It seems to me that it should be used in your PPT file since the links to Excel charts and tables are there.
 
Upvote 0
I am using excel VBA.

And have fig the way out and this is working as per the need, hope it will be helpfull for every one of us.


VBA Code:
Sub updateppt()

Dim strTemplate As String
Dim strTemplate1 As String
Dim Fname As String

        
    Fpath = ActiveWorkbook.Path
    
    strTemplate = Fpath & "\" & "Fiber Speed Test Summary - Daily.pptx"
    strTemplate1 = Fpath & "\" & "Final Daily PPT Backup"
   

Application.DisplayAlerts = False

Set PPT = CreateObject("PowerPoint.Application")
PPT.Visible = True
PPT.Presentations.Open (strTemplate), Untitled:=msoTrue
PPT.ActivePresentation.UpdateLinks

PPT.ActivePresentation.SaveAs Filename:=strTemplate1 & "\" & Sheets("Report").Range("c1").Value & ".pptx"
'PPT.ActivePresentation.Slides(i).Shapes(s).LinkFormat.BreakLink
PPT.ActivePresentation.Close
Set PPT = Nothing




Application.DisplayAlerts = True



End Sub
 
Upvote 0
Solution
Thanks for posting your own answer. I confirmed it as the marked solution since the way you solved it is perfectly fine. It is all about referencing the active window in its own Application, which is PPT here.

However, if you would like to see better way of doing this instead of depending on the active window object in VBA that will mostly end up with unexpected results, then please look at the following code and comments.

VBA Code:
Dim PPT As Object 'PowerPoint.Application
Dim objPpp As Object  'PowerPoint.Presentation
Set PPT = CreateObject("PowerPoint.Application")
' You don't need to make the PPT visible with this approach
' PPT.Visible = True

' Create an object instead of using the ActivePresentation property
Set objPpp = PPT.Presentations.Open(strTemplate, Untitled:=msoTrue)
' Now you can do anything on the object, you don't need ActivePresentation anymore
With objPpp
    .UpdateLinks
    .SaveAs FileName:=strTemplate1 & "\" & Sheets("Report").Range("c1").Value & ".pptx"
    .Close
End With
' Simply quit PPT application instead setting the variable as Nothing
PPT.Quit
 
Upvote 0
Thanks for posting your own answer. I confirmed it as the marked solution since the way you solved it is perfectly fine. It is all about referencing the active window in its own Application, which is PPT here.

However, if you would like to see better way of doing this instead of depending on the active window object in VBA that will mostly end up with unexpected results, then please look at the following code and comments.

VBA Code:
Dim PPT As Object 'PowerPoint.Application
Dim objPpp As Object  'PowerPoint.Presentation
Set PPT = CreateObject("PowerPoint.Application")
' You don't need to make the PPT visible with this approach
' PPT.Visible = True

' Create an object instead of using the ActivePresentation property
Set objPpp = PPT.Presentations.Open(strTemplate, Untitled:=msoTrue)
' Now you can do anything on the object, you don't need ActivePresentation anymore
With objPpp
    .UpdateLinks
    .SaveAs FileName:=strTemplate1 & "\" & Sheets("Report").Range("c1").Value & ".pptx"
    .Close
End With
' Simply quit PPT application instead setting the variable as Nothing
PPT.Quit
i did modified the smae but getting an error

VBA Code:
Sub updateppttest()

Dim PPT As Object 'PowerPoint.Application
Dim objPpp As Object  'PowerPoint.Presentation
Set PPT = CreateObject("PowerPoint.Application")
Dim strTemplate As String

strTemplate = Fpath & "\" & "FTTH Technical Complaints Weekly Master1.pptx"

' You don't need to make the PPT visible with this approach
' PPT.Visible = True

' Create an object instead of using the ActivePresentation property
Set objPpp = PPT.Presentations.Open(strTemplate, Untitled:=msoTrue)  ''[B] Here is the error[/B]
' Now you can do anything on the object, you don't need ActivePresentation anymore
With objPpp
    .UpdateLinks
    .SaveAs fileName:=strTemplate1 & "\" & Sheets("Report").Range("b1").Value & ".pptx"
    .Close
End With
' Simply quit PPT application instead setting the variable as Nothing
PPT.Quit


End Sub
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top