• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help Required on Compatibility Report

Calgarian

New Member
Hello All,

I had the following VBA code that was working in Excel 97-2003, but now when I am running that in 2007/2010 it is stopped at:

Set mybar = CommandBars.Add(Name:="PowerBar", Position:=msoBarTop, Temporary:=True)

and producing following compatibility report, any idea how to fix this? there may be other compatibility issue so advise your best.


------------------------
Code:
Public Sub Auto_Open()
Dim Btn1 As CommandBarButton
  Dim mybar As CommandBar
  'Create a temporary toolbar called PowerBar, this will be available
  'while Excel is running once this spreadsheet is opened
  'CommandBars("PowerBar").Delete
  Set mybar = CommandBars.Add(Name:="PowerBar", Position:=msoBarTop, Temporary:=True)
 
  '.Position = msoBarTop
  'Create a button that runs the necessary macro
  Set Btn1 = mybar.Controls.Add(Type:=msoControlButton, Temporary:=True)
  Btn1.Caption = "Update Info"
  Btn1.OnAction = "GetInfo"
  Btn1.Style = msoButtonIconAndCaption
  Btn1.FaceId = 286
  mybar.Visible = True
End Sub
--------
Compatibility Report for Info.xls
Run on 2014-02-04 6:42

The following features in this workbook are not supported by earlier versions of Excel. These features may be lost or degraded when opening this workbook in an earlier version of Excel or if you save this workbook in an earlier file format.
Minor loss of fidelity # of occurrences Version
Some cells or styles in this workbook contain formatting that is not supported by the selected file format. These formats will be converted to the closest format available. 2 Excel 97-2003
 
Last edited by a moderator:
Hi ,

I use Excel 2007 ; I ran your code , and it did not give any error message ; it created the new command bar.

Narayan
 
Back
Top