none
Macro Security Prompted Repeatedly RRS feed

  • Question

  • Hi All,

    We are creating a Macro in PowerPoint 2007. In our macro we have a line for exporting slides into image (.jpg) file. Everytime the line or sub routine is hit we always get a security prompt to enable the macro even after enabling all macro from Trust center and also enabling Trust access to the VBA project object model. Below is our code

    Private Sub CreateThumbnails(ByVal sldno As Integer)
    On Error Resume Next
       
        Dim path As String
        Dim fileName As String
        Const graphic_type As String = "jpg"
        Const scalewitdh As Long = 110
        Const scaleheight As Long = 70
        
        path = GetTmpPath
        fileName = "Slide" & CStr(sldno) & ".jpg"
        
        ActivePresentation.Slides(sldno).Export path & "" & fileName, graphic_type, scalewitdh, scaleheight
    End Sub
    


    Is there anything we have to do? Need some help. If I have posted on the wrong Forum please give me a link to the correct Forum.

    And also what do we need to reference in order to be able to use String(Number as Long, Character) function and Chr() function in VBA.


    Thanks
    SN Zeih ZeZen
    • Edited by SN Ngaihte Saturday, May 2, 2009 10:38 AM
    Saturday, May 2, 2009 10:29 AM

Answers

  • Can you check if

        Application.DisplayAlerts = ppAlertsNone

    before the following line helps

        ActivePresentation.Slides(sldno).Export path & "" & fileName, graphic_type, scalewitdh, scaleheight

    String and Chr are functions of VBA library (C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL)

    Cheers
    Shasur


    http://www.vbadud.blogspot.com
    • Marked as answer by SN Ngaihte Friday, May 15, 2009 12:42 PM
    Saturday, May 2, 2009 1:02 PM
  • Hi Shasur,

    Thanks for the help, I tried your suggestion regarding the alert, but it doesn't stop the macro alert that I talked about.

    Is there any other way?

    Thanks

    SN Zeih ZeZen
    • Marked as answer by SN Ngaihte Friday, May 15, 2009 12:42 PM
    Tuesday, May 5, 2009 10:52 AM

All replies

  • Can you check if

        Application.DisplayAlerts = ppAlertsNone

    before the following line helps

        ActivePresentation.Slides(sldno).Export path & "" & fileName, graphic_type, scalewitdh, scaleheight

    String and Chr are functions of VBA library (C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL)

    Cheers
    Shasur


    http://www.vbadud.blogspot.com
    • Marked as answer by SN Ngaihte Friday, May 15, 2009 12:42 PM
    Saturday, May 2, 2009 1:02 PM
  • Hi Shasur,

    Thanks for the help, I tried your suggestion regarding the alert, but it doesn't stop the macro alert that I talked about.

    Is there any other way?

    Thanks

    SN Zeih ZeZen
    • Marked as answer by SN Ngaihte Friday, May 15, 2009 12:42 PM
    Tuesday, May 5, 2009 10:52 AM