How to Embed/Host Excel in WPF application

ganpat gutte 5 Reputation points
2023-08-14T21:57:22.8533333+00:00

I am trying to embed Excel workbook in WPF application using Microsoft.Office.Interop.Excel
I am able to open the workbook and embed it into WPF using win32 api SetParent.

after embedding the workbook upon executing VBA (just a debug statement in selection change event handler) causes the workbook goes deactivate and to work with it again it needs to be activated using double clicking on the workbook.

Expectactions: it needs to be working same as standalone excel application embedded in WPF application.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,853 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,176 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,345 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.