S
Steve Niles
I am trying to use the Automation interface to programatically access Excel.
A sample program builds and runs fine on my co-workers system, but produces
compile errors on mine. We both have Visual Studio 2005 and Office 2007. He
runs XP, and I run Vista Ultimate.
Here are my imports:
#include "stdafx.h"
#include <atlbase.h>
#include <atlcom.h>
#include "PRJTest.h"
#include "PRJTestDlg.h"
#import "C:\Program Files\Common Files\Microsoft Shared\OFFICE12\mso.dll"
rename("RGB", "MSRGB")
#import "C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB" raw_interfaces_only, rename("Reference",
"ignorethis"), rename("VBE", "testVBE")
#import "C:\Program Files\Microsoft Office\OFFICE12\excel.exe"
exclude("IFont", "IPicture") rename("RGB", "ignorethis"), rename("DialogBox",
"ignorethis"), rename("VBE", "testVBE"), rename("ReplaceText",
"EReplaceText"), rename("CopyFile","ECopyFile"), rename("FindText",
"EFindText"), rename("NoPrompt", "ENoPrompt")
#import "C:\Program Files\Microsoft Office\OFFICE12\MSPRJ.OLB" auto_search
exclude("IFont", "IPicture") rename("RGB", "ignorethis"), rename("DialogBox",
"ignorethis"), rename("VBE", "testVBE"), rename("ReplaceText",
"EReplaceText"), rename("CopyFile","ECopyFile"), rename("FindText",
"EFindText"), rename("NoPrompt", "ENoPrompt")
On compile, I get error messages:
#import referenced a type from a missing type library; '__missing_type__'
used as a placeholder
1>c:\users\sniles\documents\visual studio
2005\source10\prjtest\prjtest\debug\vbe6ext.tlh(463) : error C2061: syntax
error : identifier '__missing_type__'
The line in vbe6ext.tlh that complains is:
virtual HRESULT __stdcall get_CommandBars (
/*[out,retval]*/ __missing_type__ * * ppcbs ) = 0;
The missing type is _CommandBars
I've seen this problem reported in various forums, but I have yet to see
anyone receive any answer.(example:
http://www.codeguru.com/forum/archive/index.php/t-263709.html)
A sample program builds and runs fine on my co-workers system, but produces
compile errors on mine. We both have Visual Studio 2005 and Office 2007. He
runs XP, and I run Vista Ultimate.
Here are my imports:
#include "stdafx.h"
#include <atlbase.h>
#include <atlcom.h>
#include "PRJTest.h"
#include "PRJTestDlg.h"
#import "C:\Program Files\Common Files\Microsoft Shared\OFFICE12\mso.dll"
rename("RGB", "MSRGB")
#import "C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB" raw_interfaces_only, rename("Reference",
"ignorethis"), rename("VBE", "testVBE")
#import "C:\Program Files\Microsoft Office\OFFICE12\excel.exe"
exclude("IFont", "IPicture") rename("RGB", "ignorethis"), rename("DialogBox",
"ignorethis"), rename("VBE", "testVBE"), rename("ReplaceText",
"EReplaceText"), rename("CopyFile","ECopyFile"), rename("FindText",
"EFindText"), rename("NoPrompt", "ENoPrompt")
#import "C:\Program Files\Microsoft Office\OFFICE12\MSPRJ.OLB" auto_search
exclude("IFont", "IPicture") rename("RGB", "ignorethis"), rename("DialogBox",
"ignorethis"), rename("VBE", "testVBE"), rename("ReplaceText",
"EReplaceText"), rename("CopyFile","ECopyFile"), rename("FindText",
"EFindText"), rename("NoPrompt", "ENoPrompt")
On compile, I get error messages:
#import referenced a type from a missing type library; '__missing_type__'
used as a placeholder
1>c:\users\sniles\documents\visual studio
2005\source10\prjtest\prjtest\debug\vbe6ext.tlh(463) : error C2061: syntax
error : identifier '__missing_type__'
The line in vbe6ext.tlh that complains is:
virtual HRESULT __stdcall get_CommandBars (
/*[out,retval]*/ __missing_type__ * * ppcbs ) = 0;
The missing type is _CommandBars
I've seen this problem reported in various forums, but I have yet to see
anyone receive any answer.(example:
http://www.codeguru.com/forum/archive/index.php/t-263709.html)