Bug #72976 Importing same table twice fails after deleting Excel table linked to the first
Submitted: 12 Jun 2014 3:14 Modified: 1 Jul 2014 0:00
Reporter: Javier Treviño Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL for Windows: MySQL for Excel Severity:S2 (Serious)
Version:1.3.0 OS:Any
Assigned to: CPU Architecture:Any

[12 Jun 2014 3:14] Javier Treviño
Description:
Importing same table twice in the same Excel worksheet fails after deleting Excel table linked to the first import.

How to repeat:
1. Enable the MySQL for excel plugin.
2. Open a valid connection and import some data.
3. Select all the columns in excel which contains data (CTRL + click in the column header).
4. Delete the columns (right click on any of the selected column->Delete).
5. Repeat step 2.
6. Note the data is not displayed just:
ExternalData_1: Getting Data ...

The MySQL for Excel log has the following entry:
MySQLForExcel Error: 1 : Application Exception on MySqlDataTable.CreateExcelTable - The control cannot be added because a control with the name sakila.actor.2 already exists in the Controls collection.
   at Microsoft.Office.Tools.Excel.ControlCollectionImpl.CheckIfValidName(String name)
   at Microsoft.Office.Tools.Excel.ControlCollectionImpl.AddListObject(ListObject listObject)
   at Microsoft.Office.Tools.Excel.ListObjectImpl.GetVstoObject(IVstoObjectProvider objectProvider, ListObject listObject)
   at Microsoft.Office.Tools.Excel.ApplicationFactoryImpl.GetVstoObject(ListObject listObject)
   at MySQL.ForExcel.Classes.MySqlDataTable.CreateExcelTable(Range atCell)
    DateTime=2014-05-23T16:55:17.1457679Z
    Timestamp=28176267407
    Callstack=   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
[12 Jun 2014 20:03] Javier Treviño
Posted by developer:
 
Changed the way connections are created for Excel 2013, instead of creating a connection for an Excel command type we create a default command type one (like we do for Excel 2007 and 2010) which fixes this particular bug.
[27 Jun 2014 13:50] Rafael Antonio Bedoy Torres
Posted by developer:
 
Fixed, checked using mysql-for-excel-commercial-1.3.1.
[1 Jul 2014 0:00] Philip Olson
Fixed as of the upcoming MySQL for Excel 1.3.1 release, and here's the changelog entry:

In Excel 2013, importing the same table twice in the same Excel worksheet
failed after deleting the Excel table linked to in the first report.

Thank you for the bug report.