Below we present bugs we are aware of in Excel & VBA (versions 2007 or later only). A software bug is an error or flaw in a computer program, that produces an incorrect or unexpected result or causes it to behave in unintended ways.
Please contact us to submit your experience.
Please contact us to submit your experience.
VBA: Code execution stops immediately after a Workbooks.Open command
Versions affected by the bug: 2007, 2010
How is the bug usually triggered:
How is the bug usually triggered:
- Running a macro using a keyboard shortcut with a CTRL-SHIFT key combination.
- As soon as the SHIFT key is pressed, while the Workbooks.Open command is being processed, code execution is terminated.
VBA: .SpecialCells() method doesn't work as expected
Versions affected by the bug:
How is the bug usually triggered:
Microsoft support article: The .SpecialCells(xlCellTypeBlanks) VBA function does not work as expected in Excel
- 2007 only.
- The error is fixed in Excel 2010. Non-contiguous cells that can be selected in Excel 2010: 2,147,483,648 cells
How is the bug usually triggered:
Microsoft support article: The .SpecialCells(xlCellTypeBlanks) VBA function does not work as expected in Excel
VBA: Excel crashes if code using a sheet CodeName is executed, after the sheet is deleted
Versions affected by the bug: 2007, 2010, 2013
For more detailed info, please read our detailed article on CodeNames best practices here.
For more detailed info, please read our detailed article on CodeNames best practices here.
Excel / VBA: "The Image part with relationship ID rId1 was not found in the file" shown instead of a picture
Versions affected by the bug:
How is the bug usually triggered:
- 2007, 2010.
- The error is fixed in Excel 2013.
How is the bug usually triggered:
- When worksheets, which contain images, are copied from their source to a target workbook using VBA code.
- After the worksheets have been copied to the new workbook, the pictures are missing and the message 'The image part with relationship ID rId1 was not found in the file.' is shown instead.
- The problem doesn't occur, if the worksheets are copied manually from Excel.
An ActiveX control does not reappear as expected in an Excel 2010 workbook, when you unhide the column(s) that include the control
Please read Article ID: 2503335
Forms Control (button) does not reappear as expected, when you unhide the row(s) that include the control after saving and closing using Excel 2010
Versions affected by the bug:
In Excel 2010, when saving and closing files containing hidden rows with objects such as Forms Controls (e.g.buttons) the controls are collapsed to a height of zero.
The property for each control is set to 'Move and size with cells', otherwise the buttons won't get hidden.
The controls don’t re-appear when the rows are unhidden. Our test VBA code shows that the buttons inside the hidden rows have zero height, even after the rows are unhidden.
Please note that controls re-appear as expected, if the workbook is still open (not saved & closed).
- 2010 (fixed in 2013)
In Excel 2010, when saving and closing files containing hidden rows with objects such as Forms Controls (e.g.buttons) the controls are collapsed to a height of zero.
The property for each control is set to 'Move and size with cells', otherwise the buttons won't get hidden.
The controls don’t re-appear when the rows are unhidden. Our test VBA code shows that the buttons inside the hidden rows have zero height, even after the rows are unhidden.
Please note that controls re-appear as expected, if the workbook is still open (not saved & closed).
Sub ResetButtonSize() Dim oBtn As Shape Dim oRng As Range For Each oBtn In ActiveSheet.Shapes If oBtn.FormControlType = xlButtonControl Then Set oRng = oBtn.TopLeftCell If Not oRng.EntireRow.Hidden Then With oBtn .Left = oRng.Left .Top = oRng.Top .Width = oRng.Width .Height = oRng.Height End With End If End If Next oBtn End Sub
Loss of Ribbon UI object reference after a VBA runtime error
Versions affected by the bug:
- 2007, 2010, 2013.
The ribbon object is initialized, when Excel loads a workbook or Addin. After a VBA runtime error, the memory reference to the Ribbon object is permanently lost. This means that VBA code cannot update Excel's Ribbon customization any longer.
Workaround solutions:
- Close & re-open active workbook (not user-friendly)
- Avoid Ribbon customizations - use of oRibbon.invalidate - in the first place, if possible.
- Store the memory pointer of the Ribbon object & reset reference (by Rory Archibald, MVP)
Office 2010 x64 refuses to register events of CommandBar controls of the VBA Editor
Versions affected by the bug: 2010 64-bit
The statement:
Set MenuEvent.EvtHandler = Application.VBE.Events.CommandBarEvents(CmdBarItem) in the repro file returns an error.
There are no alternative means to achieve the same effect, so it is not currently possible to create useable menus for the VBA Editor in Office 2010 x64. The bug appears to have been fixed in Office 2013 x64.
The VBA code in the repro file was found on Chip Pearson’s website
The statement:
Set MenuEvent.EvtHandler = Application.VBE.Events.CommandBarEvents(CmdBarItem) in the repro file returns an error.
There are no alternative means to achieve the same effect, so it is not currently possible to create useable menus for the VBA Editor in Office 2010 x64. The bug appears to have been fixed in Office 2013 x64.
The VBA code in the repro file was found on Chip Pearson’s website
Excel 2007 Add-in crashes after ThisWorkbook.FollowHypelink
Versions affected by the bug:
How is the bug triggered:
- 2007
- The error is fixed in Excel 2010.
How is the bug triggered:
- Create an Excel 2007 Add-in
- Run VBA code with the ThisWorkbook.FollowHyperlink method
Please note that ActiveWorkbook.FollowHyperlink works OK, if there is an active workbook present.
Excel ListObjects (Table) cannot be renamed in 2007-2010 Add-ins
Versions affected by the bug:
- 2007-2010
- The error is fixed in Excel 2013.
How is the bug triggered:
- Create any Excel Table
- Save workbook as an Excel 2007 or 2010 Add-in (no error in workbooks)
- Run this VBA code: ThisWorkbook.Sheets(1).ListObjects(1).Name = "NewName"