exe file is not recognized as an internal or external command, operable program or batch file in C++

时间:2017-04-09 23:36:07

标签: c++ excel windows

I have generate a code for my study and it is working but when I adding Linked header for connect it with EXCEL this message appears ("... .exe" is not recognized as an internal or external command, operable program or batch file in C++)

My code includes C++ & CPLEX. the code is working in other PC without any problem but in my PC this appear. My study is not about computer sciences so I am not expert. My windows 10 and office 2016.

this is linked header

    #pragma once
#pragma region Includes
#include <stdio.h>
#include <windows.h>
#pragma endregion

#pragma region Import the type libraries

//#import "libid:2DF8D04C-5BFA-101B-BDE5-00AA0044DE52" \
//    rename("RGB", "MSORGB") \
//    rename("DocumentProperties", "MSODocumentProperties")
// [-or-]
#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE16\\MSO.DLL" \
    rename("RGB", "MSORGB") \
    rename("DocumentProperties", "MSODocumentProperties")

using namespace Office;

//#import "libid:0002E157-0000-0000-C000-000000000046"
// [-or-]
#import "C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.OLB"

using namespace VBIDE;

//#import "libid:00020813-0000-0000-C000-000000000046" \
//    rename("DialogBox", "ExcelDialogBox") \
//    rename("RGB", "ExcelRGB") \
//    rename("CopyFile", "ExcelCopyFile") \
//    rename("ReplaceText", "ExcelReplaceText") \
//    no_auto_exclude
// [-or-]
#import "C:\\Program Files\\Microsoft Office\\Office16\\EXCEL.EXE" \
    rename("DialogBox", "ExcelDialogBox") \
    rename("RGB", "ExcelRGB") \
    rename("CopyFile", "ExcelCopyFile") \
    rename("ReplaceText", "ExcelReplaceText") \
    no_auto_exclude

#pragma endregion

this is the message and error

Message

ERROR

1 个答案:

答案 0 :(得分:1)

Sounds like you don't actually have Excel installed on the computer.