Ian Beckett

RSS feed

    Recent comments

    Authors

    VBA, How to stop list box activeX control autosize

    Set IntegralHeight property to false...

    ListBox1.IntegralHeight = False

    "An ActiveX ListBox Control has a IntegralHeight Property, which by default is set to True. Go into the Properties Window of the ListBox and set it to False. This should stop the Auto re-sizing. -Dave Hawley "

    http://www.ozgrid.com/forum/showthread.php?t=10568


    Posted by ibeckett on Wednesday, February 10, 2010 7:33 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Excel Services Compatibility Checker

    One of the annoyances that I have come across in my short time working with Excel Services is the cycle of; change workbook -> publish to share point -> make sure everything works -> repeat.  Today I happened to find a compatibility checker that works extremely well, especially considering that it is in (probably permanent) beta.

    I don't think that I can do a better job explaining how to use it than the author, so just go check out the site!  If you just want to download the installation file, you can get it here.


    Issues that the compatiblity checker knows how to find/fix

    The following is a list of the issues that can be found:

    AutoFix available (all of these will be removed from the workbook when auto-fixed):

    • Comments
    • DialogSheets
    • Display Formulas
    • Macro Sheet
    • OleObjects
    • Query Tables
    • Shapes
    • Validation
    • XML Maps

    AutoFix sometimes available (will be removed if possible):

    • IRM - AutoFix will work if there's no password.
    • Protection - AutoFix will work if there's no password.
    • VBA - AutoFix will work if the trust-cente enables Automation to interact with the VBA project.

    AutoFix will not work for these:

    • Unsupported formulas such as External Workbooks and RTD()
    • FileFormatResult

    excerpt from http://blogs.msdn.com/cumgranosalis


    Posted by ibeckett on Saturday, June 20, 2009 5:01 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    View a pivot table's underlying MDX query in Excel

    After running these scripts you can easily view the underlying MDX query for any pivot table that uses a SSAS cube for its datasource:
     

    Use the following script to add a show MDX Query option when you right click a pivot table in Excel 2007:

    Private Sub Workbook_Open()
       Dim ptcon As CommandBar
       
        Set ptcon = Application.CommandBars("PivotTable context menu")

    insertDisplayMDX:
       Dim cmdMdx As CommandBarControl
       For Each btn In ptcon.Controls
           If btn.Caption = "MDX Query" Then GoTo doneDisplayMDX
       Next btn
      
       ' Add an item to the PivotTable context menu.
       Set cmdMdx = ptcon.Controls.Add(Type:=msoControlButton, temporary:=True)
      
       ' Set the properties of the menu item.
       cmdMdx.Caption = "MDX Query"
       cmdMdx.OnAction = "DisplayMDX"
          
    doneDisplayMDX:

    End Sub 



    And put this in a seperate module:
    Sub DisplayMDX()
        Dim mdxQuery As String
        Dim pvt As PivotTable
        Dim ws As Worksheet
      
        Set pvt = ActiveCell.PivotTable
        mdxQuery = pvt.MDX
       
        ' Add a new worksheet.
        Set ws = Worksheets.Add
        ws.Range("A1") = mdxQuery
    End Sub

    Works great!

    The code comes from http://sqljunkies.com/WebLog/sqlbi/archive/2007/01/18/26875.aspx


    Posted by ibeckett on Sunday, February 01, 2009 6:04 AM
    Permalink | Comments (0) | Post RSSRSS comment feed