【问题标题】:Script to check for PowerPivot and prompt user to install检查 PowerPivot 并提示用户安装的脚本
【发布时间】:2011-12-19 21:45:40
【问题描述】:

是否有人看过用于检查用户的 PowerPivot 插件并为用户提供安装对话框的脚本?

【问题讨论】:

    标签: excel vba excel-2010 powerpivot


    【解决方案1】:

    不幸的是,PowerPivot 似乎没有列在 VBA 可访问的已安装插件列表中。

    也许你想试试这个:

    Sub installPowerPivot()
    If Not isPowerPivotInstalled Then
        MsgBox "PowerPivot is not installed on this machine." & vbCrLf & vbCrLf & _
            "Please visit this website to download the PowerPivot add-in:" & vbCrLf & _
            "http://powerpivot.com"
    End If
    End Sub
    
    
    Function isPowerPivotInstalled() As Boolean
    Const checkFile As String = "\Microsoft Analysis Services\AS Excel Client\10\Microsoft.AnalysisServices.Modeler.FieldList.dll"
    Dim tempFSO As Object
    Set tempFSO = CreateObject("Scripting.FileSystemObject")
    
    'check x86 program files folder
    If tempFSO.fileexists(Environ("ProgramFiles(x86)") & checkFile) Then
        isPowerPivotInstalled = True
        Exit Function
    End If
    
    'if it's a 64bit machine also check the 64bit program files folder
    If LCase(Environ("processor_architecture")) = "amd64" Then
        If tempFSO.fileexists(Environ("ProgramW6432") & checkFile) Then
            isPowerPivotInstalled = True
            Exit Function
        End If
    End If
    
    'if both checks fail -> false
    isPowerPivotInstalled = False
    End Function
    

    【讨论】:

    • 我们走了一条不同的路线(类似),但我希望将我的问题标记为已回答,以免我被避免在未来得到答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-04
    • 1970-01-01
    • 2015-12-03
    • 1970-01-01
    相关资源
    最近更新 更多