【问题标题】:exe file is not recognized as an internal or external command, operable program or batch file in C++exe 文件在 C++ 中不被识别为内部或外部命令、可运行程序或批处理文件
【发布时间】:2017-04-09 23:36:06
【问题描述】:

我已经为我的学习生成了一个代码,它正在工作,但是当我添加 Linked 标头以将其与 EXCEL 连接时,会出现此消息 (“... .exe”在 C++ 中不被识别为内部或外部命令、可运行程序或批处理文件)

我的代码包括 C++ 和 CPLEX。 该代码在其他PC上运行没有任何问题,但在我的PC上出现。 我的研究不是关于计算机科学的,所以我不是专家。 我的 Windows 10 和 Office 2016。

这是链接标题

    #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

这是消息和错误

Message

ERROR

【问题讨论】:

  • 为什么要添加批处理文件标签?您的问题与批处理文件无关。
  • 我不知道什么是批处理文件,我不是专家

标签: c++ excel windows


【解决方案1】:

听起来您的计算机上实际上并没有安装 Excel。

【讨论】:

    猜你喜欢
    • 2018-01-02
    • 2015-04-28
    • 2016-06-19
    • 1970-01-01
    • 2015-12-30
    • 2018-07-08
    • 2021-11-07
    相关资源
    最近更新 更多