Discussion:
Where is Excel.h?
(too old to reply)
Cameron_C
2008-12-05 21:00:40 UTC
Permalink
I am having a problem finding Excel.h.
I understand the file is created when you follow the instructions in the
knowledgebase article.
I am running Visual Studio 2008. Mot MFC 6.0
So, I cannot generate the files.

Do I need to install C++6.0, just to get the files Excel.h and Excel.cpp?

Any advice/ suggestions would be appreciated.
I see the same question was asked a couple of years ago, and I see that the
individual found a solution, but he does not actually say that the solution
was to generate the files under C++ 6.0.

Thank you.
AliR (VC++ MVP)
2008-12-05 21:18:46 UTC
Permalink
Which knowledgebase article?

AliR.
Post by Cameron_C
I am having a problem finding Excel.h.
I understand the file is created when you follow the instructions in the
knowledgebase article.
I am running Visual Studio 2008. Mot MFC 6.0
So, I cannot generate the files.
Do I need to install C++6.0, just to get the files Excel.h and Excel.cpp?
Any advice/ suggestions would be appreciated.
I see the same question was asked a couple of years ago, and I see that the
individual found a solution, but he does not actually say that the solution
was to generate the files under C++ 6.0.
Thank you.
Cameron_C
2008-12-05 22:18:57 UTC
Permalink
It is Q178749.
http://support/microsoft.com/kb/178749
Post by AliR (VC++ MVP)
Which knowledgebase article?
AliR.
Post by Cameron_C
I am having a problem finding Excel.h.
I understand the file is created when you follow the instructions in the
knowledgebase article.
I am running Visual Studio 2008. Mot MFC 6.0
So, I cannot generate the files.
Do I need to install C++6.0, just to get the files Excel.h and Excel.cpp?
Any advice/ suggestions would be appreciated.
I see the same question was asked a couple of years ago, and I see that the
individual found a solution, but he does not actually say that the solution
was to generate the files under C++ 6.0.
Thank you.
AliR (VC++ MVP)
2008-12-05 22:41:34 UTC
Permalink
Ok for setup 8 through 10 do the following

From the menu select Project/Add Class.
In the Add Class dialog box select MFC Class From TypeLib
In the Avaliable type Library combobox select Microsoft Execl XX.0 Object
Library
Then you can simply select the interfaces that you are interested in and
press finish. If you have selected more than one interface it will create
more than one .h files.

Hope this helps.
AliR.
Post by Cameron_C
It is Q178749.
http://support/microsoft.com/kb/178749
Post by AliR (VC++ MVP)
Which knowledgebase article?
AliR.
Post by Cameron_C
I am having a problem finding Excel.h.
I understand the file is created when you follow the instructions in the
knowledgebase article.
I am running Visual Studio 2008. Mot MFC 6.0
So, I cannot generate the files.
Do I need to install C++6.0, just to get the files Excel.h and Excel.cpp?
Any advice/ suggestions would be appreciated.
I see the same question was asked a couple of years ago, and I see that the
individual found a solution, but he does not actually say that the solution
was to generate the files under C++ 6.0.
Thank you.
Cameron_C
2008-12-05 23:42:02 UTC
Permalink
Thanks I will try that.
The instructions say to select Excel.exe. I guess that is why there were so
many.h files created.
I will get back to you.
But thanks very much for the direction. I have my fingers crossed......
Post by AliR (VC++ MVP)
Ok for setup 8 through 10 do the following
From the menu select Project/Add Class.
In the Add Class dialog box select MFC Class From TypeLib
In the Avaliable type Library combobox select Microsoft Execl XX.0 Object
Library
Then you can simply select the interfaces that you are interested in and
press finish. If you have selected more than one interface it will create
more than one .h files.
Hope this helps.
AliR.
Post by Cameron_C
It is Q178749.
http://support/microsoft.com/kb/178749
Post by AliR (VC++ MVP)
Which knowledgebase article?
AliR.
Post by Cameron_C
I am having a problem finding Excel.h.
I understand the file is created when you follow the instructions in the
knowledgebase article.
I am running Visual Studio 2008. Mot MFC 6.0
So, I cannot generate the files.
Do I need to install C++6.0, just to get the files Excel.h and Excel.cpp?
Any advice/ suggestions would be appreciated.
I see the same question was asked a couple of years ago, and I see that the
individual found a solution, but he does not actually say that the solution
was to generate the files under C++ 6.0.
Thank you.
Cameron_C
2008-12-06 03:59:01 UTC
Permalink
I still have the same issue.
I think that I need to include all of the files that were generated by
selecting the template library, and there were a lot of them.
But, there were no files named excel.h or excel.cpp.

And I get about two hundred compile errors of the format:

Error 1 error C2371: 'FontPtr' : redefinition; different basic
types c:\documents and settings\cconac\my documents\visual studio
2005\projects\excel test3\excel test3\debug\excel.tlh 1219
Error 2 error C2786: 'BOOL (__stdcall *)(HDC,int,int,int,int)' : invalid
operand for __uuidof c:\documents and settings\cconac\my documents\visual
studio 2005\projects\excel test3\excel test3\debug\excel.tlh 1297
Error 3 error C2923: '_com_IIID' : 'Rectangle' is not a valid template type
argument for parameter '_Interface' c:\documents and settings\cconac\my
documents\visual studio 2005\projects\excel test3\excel
test3\debug\excel.tlh 1297
Error 4 error C3203: '_com_IIID' : unspecialized class template can't be
used as a template argument for template parameter '_IIID', expected a real
type c:\documents and settings\cconac\my documents\visual studio
2005\projects\excel test3\excel test3\debug\excel.tlh 1297
Error 5 error C2786: 'BOOL (__stdcall
*)(HDC,int,int,int,int,int,int,int,int)' : invalid operand for
__uuidof c:\documents and settings\cconac\my documents\visual studio
2005\projects\excel test3\excel test3\debug\excel.tlh 1301
Error 6 error C2923: '_com_IIID' : 'Arc' is not a valid template type
argument for parameter '_Interface' c:\documents and settings\cconac\my
documents\visual studio 2005\projects\excel test3\excel
test3\debug\excel.tlh 1301
Post by Cameron_C
Thanks I will try that.
The instructions say to select Excel.exe. I guess that is why there were so
many.h files created.
I will get back to you.
But thanks very much for the direction. I have my fingers crossed......
Post by AliR (VC++ MVP)
Ok for setup 8 through 10 do the following
From the menu select Project/Add Class.
In the Add Class dialog box select MFC Class From TypeLib
In the Avaliable type Library combobox select Microsoft Execl XX.0 Object
Library
Then you can simply select the interfaces that you are interested in and
press finish. If you have selected more than one interface it will create
more than one .h files.
Hope this helps.
AliR.
Post by Cameron_C
It is Q178749.
http://support/microsoft.com/kb/178749
Post by AliR (VC++ MVP)
Which knowledgebase article?
AliR.
Post by Cameron_C
I am having a problem finding Excel.h.
I understand the file is created when you follow the instructions in the
knowledgebase article.
I am running Visual Studio 2008. Mot MFC 6.0
So, I cannot generate the files.
Do I need to install C++6.0, just to get the files Excel.h and Excel.cpp?
Any advice/ suggestions would be appreciated.
I see the same question was asked a couple of years ago, and I see that the
individual found a solution, but he does not actually say that the solution
was to generate the files under C++ 6.0.
Thank you.
Mathews George
2012-02-15 12:34:13 UTC
Permalink
error C2371: 'FontPtr' : redefinition;

To solve this error try commenting statements like

#import "C:\\Program Files\\Microsoft Office\\Office12\\EXCEL.EXE" in class generated from type lib
Post by Cameron_C
I am having a problem finding Excel.h.
I understand the file is created when you follow the instructions in the
knowledgebase article.
I am running Visual Studio 2008. Mot MFC 6.0
So, I cannot generate the files.
Do I need to install C++6.0, just to get the files Excel.h and Excel.cpp?
Any advice/ suggestions would be appreciated.
I see the same question was asked a couple of years ago, and I see that the
individual found a solution, but he does not actually say that the solution
was to generate the files under C++ 6.0.
Thank you.
Post by AliR (VC++ MVP)
Which knowledgebase article?
AliR.
Post by Cameron_C
It is Q178749.
http://support/microsoft.com/kb/178749
Post by AliR (VC++ MVP)
Ok for setup 8 through 10 do the following
From the menu select Project/Add Class.
In the Add Class dialog box select MFC Class From TypeLib
In the Avaliable type Library combobox select Microsoft Execl XX.0 Object
Library
Then you can simply select the interfaces that you are interested in and
press finish. If you have selected more than one interface it will create
more than one .h files.
Hope this helps.
AliR.
Post by Cameron_C
Thanks I will try that.
The instructions say to select Excel.exe. I guess that is why there were so
many.h files created.
I will get back to you.
But thanks very much for the direction. I have my fingers crossed......
Post by Cameron_C
I still have the same issue.
I think that I need to include all of the files that were generated by
selecting the template library, and there were a lot of them.
But, there were no files named excel.h or excel.cpp.
Error 1 error C2371: 'FontPtr' : redefinition; different basic
types c:\documents and settings\cconac\my documents\visual studio
2005\projects\excel test3\excel test3\debug\excel.tlh 1219
Error 2 error C2786: 'BOOL (__stdcall *)(HDC,int,int,int,int)' : invalid
operand for __uuidof c:\documents and settings\cconac\my documents\visual
studio 2005\projects\excel test3\excel test3\debug\excel.tlh 1297
Error 3 error C2923: '_com_IIID' : 'Rectangle' is not a valid template type
argument for parameter '_Interface' c:\documents and settings\cconac\my
documents\visual studio 2005\projects\excel test3\excel
test3\debug\excel.tlh 1297
Error 4 error C3203: '_com_IIID' : unspecialized class template can't be
used as a template argument for template parameter '_IIID', expected a real
type c:\documents and settings\cconac\my documents\visual studio
2005\projects\excel test3\excel test3\debug\excel.tlh 1297
Error 5 error C2786: 'BOOL (__stdcall
*)(HDC,int,int,int,int,int,int,int,int)' : invalid operand for
__uuidof c:\documents and settings\cconac\my documents\visual studio
2005\projects\excel test3\excel test3\debug\excel.tlh 1301
Error 6 error C2923: '_com_IIID' : 'Arc' is not a valid template type
argument for parameter '_Interface' c:\documents and settings\cconac\my
documents\visual studio 2005\projects\excel test3\excel
test3\debug\excel.tlh 1301
Post by Ajay Kalra
he
on
Excel.h/cpp should be created for you when you import the excel
library. These do not ship with VC/VS.
--
Ajay
Post by Cameron_C
Just for anyone following along here.
I found another couple of KB articles (thanks AliR for directing me...)
This is the OLD link which is not quite correect...
http://support.microsoft.com/kb/178781
This is a newer link http://support.microsoft.com/kb/307473/EN-US/
And this is a followon from the above link
http://support.microsoft.com/kb/308292
Thanks again veryone.
I hope this helps someone down the road.
I was confused, until I deleted all of the #import statements in all of the
header files, and then lost until I read the KB article explaining that you
may need to to change DialogBox in CRange.h to _DialogBox.
Cameron_C
2008-12-07 20:21:01 UTC
Permalink
Just for anyone following along here.
I found another couple of KB articles (thanks AliR for directing me...)
This is the OLD link which is not quite correect...
http://support.microsoft.com/kb/178781

This is a newer link http://support.microsoft.com/kb/307473/EN-US/
And this is a followon from the above link
http://support.microsoft.com/kb/308292

Thanks again veryone.
I hope this helps someone down the road.
I was confused, until I deleted all of the #import statements in all of the
header files, and then lost until I read the KB article explaining that you
may need to to change DialogBox in CRange.h to _DialogBox.
Post by AliR (VC++ MVP)
Ok for setup 8 through 10 do the following
From the menu select Project/Add Class.
In the Add Class dialog box select MFC Class From TypeLib
In the Avaliable type Library combobox select Microsoft Execl XX.0 Object
Library
Then you can simply select the interfaces that you are interested in and
press finish. If you have selected more than one interface it will create
more than one .h files.
Hope this helps.
AliR.
Post by Cameron_C
It is Q178749.
http://support/microsoft.com/kb/178749
Post by AliR (VC++ MVP)
Which knowledgebase article?
AliR.
Post by Cameron_C
I am having a problem finding Excel.h.
I understand the file is created when you follow the instructions in the
knowledgebase article.
I am running Visual Studio 2008. Mot MFC 6.0
So, I cannot generate the files.
Do I need to install C++6.0, just to get the files Excel.h and Excel.cpp?
Any advice/ suggestions would be appreciated.
I see the same question was asked a couple of years ago, and I see that the
individual found a solution, but he does not actually say that the solution
was to generate the files under C++ 6.0.
Thank you.
Ajay Kalra
2008-12-05 21:37:09 UTC
Permalink
Post by Cameron_C
I am having a problem finding Excel.h.
I understand the file is created when you follow the instructions in the
knowledgebase article.
I am running Visual Studio 2008. Mot MFC 6.0
So, I cannot generate the files.
Do I need to install C++6.0, just to get the files Excel.h and Excel.cpp?
Any advice/ suggestions would be appreciated.
I see the same question was asked a couple of years ago, and I see that the
individual found a solution, but he does not actually say that the solution
was to generate the files under C++ 6.0.
Thank you.
Excel.h/cpp should be created for you when you import the excel
library. These do not ship with VC/VS.

--
Ajay
Continue reading on narkive:
Loading...