我有一个工作簿,我在Excel2013中使用Powerpivot。在工作簿开头我使用宏
Private Sub Workbook_Open()
ActiveWorkbook.Model.Refresh
End Sub
我的问题是我与只读取数据且拥有Excel2007(不支持PowerPivot)的人共享此工作簿。所以可以做那样的事情
If version of Excel = Excel2013 Then ActiveWorkbook.Model.Refresh
Else Do Nothing
由于
Private Sub Workbook_Open()
Dim appVersion As String
appVersion = Application.Version
If appVersion = "15.0" Then
ActiveWorkbook.Model.Refresh
End If
End Sub