C++/VB - Where is Excel.h?

Asked By Cameron
05-Dec-08 04:00 PM
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.
Visual Studio 2008
(1)
Excel
(1)
DialogBox
(1)
TypeLib
(1)
FollowingFrom
(1)
Avaliable
(1)
Execl
(1)
Mot
(1)
  AliR \(VC++ MVP\) replied...
05-Dec-08 04:18 PM
Which knowledgebase article?

AliR.
  Ajay Kalra replied...
06-Dec-08 03:19 PM
he
on

Excel.h/cpp should be created for you when you import the excel
library. These do not ship with VC/VS.

--
Ajay
  Cameron replied...
05-Dec-08 05:18 PM
It is Q178749.
http://support/microsoft.com/kb/178749
  AliR \(VC++ MVP\) replied...
05-Dec-08 05:41 PM
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.
  Cameron replied...
05-Dec-08 06:42 PM
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......
  Cameron replied...
05-Dec-08 10:59 PM
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
  Cameron replied...
07-Dec-08 03:21 PM
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.
  Mathews George replied to Cameron
15-Feb-12 07:34 AM
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
help
my includes for current VC installation may get foobarred. Appreciate any input. VC MFC Discussions Visual Studio (1) PlatformSDK (1) StringCchCopy (1) Directories (1) OtherwiseI (1) Newcomer (1) Windows (1) Autocad (1 the SDK puts it in a separate directory tree from the one that came with Visual Studio. Therefore, the existing one is safe. Visual Studio can be set to use the original one or the new one by changing the order these appear in the VC++ Directories settings (specifically the Include and Lib directories). As Visual Studio searches the directories in order, you can have it give preference to either the original
Help: Is Visual Studio 2008 good enough (for VC++)? C++ / VB As I said earlier, VS2010 is very expensive. But I need new VC++. So I was thinking to buy older one, VC++2008 with Visual Studio 2008. Is this good enough to "survive" next 5 years? Does VC2010 have something essencial 2008 does not have? They both make 64 bit applications I guess. So I feel there
1. RFD: comp.lang.visual moderated (remove) C++ / VB REQUEST FOR DISCUSSION (RFD) moderated group comp.lang.visual This is a formal Request for Discussion (RFD) to remove moderated newsgroup comp.lang.visual. NEWSGROUPS LINE: comp.lang.visual General discussion of visual programming languages. (Moderated) DISTRIBUTION: news.announce.newgroups news.groups.proposals comp.lang visual PROPONENT: Alexander Bartolich <alexander.bartolich@gmx.at> CHARTER OF COMP.LANG.VISUAL A forum for general discussion of visual programming languages. A working definition of visual programming languages is posted in the regular comp
data is made. How to prevent this situation ? Is this common situation ? VC MFC Discussions Visual Studio (1) GetTopLevelParent (1) GetToolBarCtrl (1) CRichEditView (1) OnMyBtnClick (1) GetSafeHWnd (1) PreTranslateMessage (1) GetGeometricObject (1 and found the following instances where "IsWindow" is used outside the ASSERT. Thanks Seetharam - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Microsoft Visual Studio 8 \ VC \ atlmfc \ src \ mfc \ barcore.cpp(442):if (::IsWindow(m_hWnd)) Microsoft Visual Studio 8 \ VC \ atlmfc \ src \ mfc \ bartool.cpp(304):if (::IsWindow(m_hWnd)) Microsoft Visual Studio 8 \ VC \ atlmfc \ src \ mfc \ bartool.cpp(1332):if ((_afxComCtlVersion > = 3D VERSION_6) && ::IsWindow(GetToolBarCtrl())) Microsoft
compile cpp with dsp project files on windows server 2008 R2 C++ / VB I can compile some old Visual C++ cpp with dsp project files with Microsoft Platform SDK for Windows Server 2003 and Visual C++ 6 on windows server 2003 successfully. I want to compile the same cpp files with minimum change) on windows server 2008 R2. What is the best way to do that? I am thinking of installing Visual C++ 2008 Professional Edition and / or Windows SDK for Windows Server 2008 and .NET Framework 3.5 and on the windows server 2008 R2 computer. Then open and convert the project dsp files in Visual C++ 2008. Then