Can COM use Excel as an in-process DLL?

masterjodi 40 Reputation points
2024-05-03T10:05:47.41+00:00

Hello,

I would to ask about Excel COM operation.

 To connect to Excel from another C++ process is well established:

#import "C:\\Program Files (x86)\\Common Files\\microsoft shared\\OFFICE11\\MSO.DLL"
   
 
#import "C:\\Program Files (x86)\\Common Files\\microsoft shared\\VBA\\VBA6\\VBE6EXT.OLB"
   
 
#import "C:\\Program Files (x86)\\Microsoft Office\\OFFICE11\\EXCEL.EXE"
   
   
   
   
   
   

and the use CoInitialize() and other standard COM practices. However, COM marshaling between processes incurs performance penalty, albeit very little. If large amount of data is to be processed with Excel, it is desirable to embed Excel as an in-process DLL within the calling process.

I didn’t find a way to do that. Does Excel support this by design?

Customer

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,479 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,694 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,637 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 43,306 Reputation points
    2024-05-03T10:08:51.5+00:00

    it is desirable to embed Excel as an in-process DLL within the calling process.

    This cannot be done. Excel is designed to run as a out-of-process COM server.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. masterjodi 40 Reputation points
    2024-05-03T10:12:24.5066667+00:00

    Thanks.

    Excel is very handy. However its plotting does not seem to specialize in drawing mathematical functions like MATLAB or Mathematica.

    Does it actually capable of drawing very appealing math function graphs? Does Mircosoft have any product which does a good job for this?