Thread: Automate Excel with MFC Gives trouble in compilation

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    4

    Automate Excel with MFC Gives trouble in compilation

    Hi,

    http://support.microsoft.com/kb/308407

    Oh, I did my first attempt to try to

    Too many errors and s

    /// .Net 2005 , Excel2003 .. Environment / / / .Net 2005 , Excel2003 is ..


    I see an error in an error adding interface looks like tees;;


    >c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(22) : error C2146: syntax error : missing ';' before identifier 'get_Application'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(22) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(23) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(27) : warning C4183: 'get_Application': missing return type; assumed to be a member function returning 'int'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(28) : error C2146: syntax error : missing ';' before identifier 'get_Creator'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(28) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(33) : warning C4183: 'get_Creator': missing return type; assumed to be a member function returning 'int'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(24) : error C2065: 'Application' : undeclared identifier
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(24) : error C2146: syntax error : missing ';' before identifier 'result'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(24) : error C2065: 'result' : undeclared identifier
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(30) : error C2065: 'XlCreator' : undeclared identifier
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CRange.h(30) : error C2146: syntax error : missing ';' before identifier 'result'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CWorkbooks.h(22) : error C2146: syntax error : missing ';' before identifier 'get_Application'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CWorkbooks.h(22) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CWorkbooks.h(23) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CWorkbooks.h(27) : warning C4183: 'get_Application': missing return type; assumed to be a member function returning 'int'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CWorkbooks.h(28) : error C2146: syntax error : missing ';' before identifier 'get_Creator'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CWorkbooks.h(28) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CWorkbooks.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CWorkbooks.h(33) : warning C4183: 'get_Creator': missing return type; assumed to be a member function returning 'int'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CWorkbooks.h(40) : error C2061: syntax error : identifier 'Parameter'
    1>c:\apps\projects\2008-bm-proe eds checking tool\eds checking tool\ver 1.2\code\server_chn\proe_eds_check\proe_eds_check\ CWorkbooks.h(53) : error C2061: syntax error : identifier 'Parameter'

    I have followed the trouble shooting also and included

    Code:
    <pre lang="cs">// mso.dll
    #import "libid:{2df8d04c-5bfa-101b-bde5-00aa0044de52}"  auto_rename
    // vb6ext.olb
    #import "libid:{0002e157-0000-0000-c000-000000000046}"  auto_rename
    // excel.exe
    #import "libid:{00020813-0000-0000-c000-000000000046}"  auto_rename
    in the Stdafx.h

    These many errors are coming

    Anybody Know the Reason, Thanks in advance.

    Joseph
    Last edited by joseph_isreavel; 05-24-2011 at 09:57 PM.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Well, we know the reason and you do too, since you posted it. Each of the error messages says what the error is after all; start at the first one: "missing ';' before identifier 'get_Application'", which is on line 22 of CRange.h. Go to that file and that line and look for a missing semicolon (hint: the missing semicolon may be from the line above missing one). Rebuild, look at the first error message again, etc.

  3. #3
    Registered User
    Join Date
    May 2011
    Posts
    4
    Hi,

    It is actually a bug in the application. I have found the solution, In the Header the return types are varying between them, I have edited the header to replace the types with the one in the working headers.


    Application get_Application() To LPDISPATCH get_Application()

    Regards,
    Joseph

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do I automate this in bash?
    By cpjust in forum Tech Board
    Replies: 4
    Last Post: 03-21-2011, 03:54 PM
  2. How to automate IE?
    By John_L in forum C# Programming
    Replies: 4
    Last Post: 03-03-2008, 08:46 AM
  3. Automate Fast User Switching
    By haku_nin in forum Windows Programming
    Replies: 2
    Last Post: 07-29-2005, 12:44 AM
  4. automate bios
    By yinhowe in forum C Programming
    Replies: 2
    Last Post: 01-03-2003, 06:32 PM
  5. automate this??
    By Goof Program in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 01-31-2002, 06:02 AM