Bug #90475 MySql for Excel breaks Excel /Embedding mode
Submitted: 17 Apr 2018 14:26 Modified: 18 Apr 2018 7:52
Reporter: Björn Freter Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL for Windows: MySQL for Excel Severity:S3 (Non-critical)
Version:1.3.7 OS:Windows
Assigned to: CPU Architecture:x86

[17 Apr 2018 14:26] Björn Freter
Description:
MySQL for Excel always creates a new workbook on startup, which it must not do when Excel is started as a background service, or when Excel is used to load a document into an OLE container.

This also breaks compatibility with other Add-ins using Excel as a background service, such as the think-cell Add-in.

I saw that similar bugs have been reported before by other users (e.g., #86633), which may be related.

How to repeat:
Microsoft Excel 2016 MSO (16.0.9216.2116) 32-bit, MySQL for Excel 1.3.7

Reproduction 1: Start Excel with /Embedding command line switch.
Expected behavior: Excel will start in the background, without visible window, and the Application.Workbooks collection is empty.
Actual behavior (with MySQL for Excel): An Excel workbook window will pop up.

Reproduction 2: In a PowerPoint presentation, go to insert > object > Microsoft Excel Worksheet.
Expected behavior: Just the embedded worksheet opens inside the PowerPoint's container.
Actual behavior (with MySQL for Excel): an additional, empty worksheet opens in a separate Excel window.

Suggested fix:
I am refering to the source code for 1.3.7. Inside method ThisAddIn_Startup, change the line

 InitializeWorkbook(ActiveWorkbook);

to 

 InitializeWorkbook(Application.ActiveWorkbook);

Note that InitializeWorkbook is robust against workbook argument being null.
[18 Apr 2018 7:52] Chiranjeevi Battula
Hello Björn Freter,

Please note that this is duplicate of Bug #86633.
Confirmed internally that the fix to Bug #86633 also fixes both the issues reported in your bug report.

Thanks,
Chiranjeevi.