简体   繁体   English

使用Visual Studio 2015社区版在C ++中#include excel错误

[英]#include excel error in C++ with Visual Studio 2015, Community edition

I am trying to visualize my experimental data in excel. 我正在尝试在excel中可视化我的实验数据。 The following import statement give me errors: 以下导入语句给我错误:

#import "C:\Program Files\Microsoft Office 15\root\vfs\ProgramFilesCommonX86\Microsoft Shared\OFFICE15\MSO.DLL" rename("DocumentProperties", "DocumentPropertiesXL") rename("RGB", "RGBXL")
#import "C:\Program Files\Microsoft Office 15\root\vfs\ProgramFilesCommonX86\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB"
#import "C:\Program Files\Microsoft Office 15\root\office15\EXCEL.EXE" rename("DialogBox", "DialogBoxXL") rename("RGB", "RGBXL") rename("DocumentProperties", "DocumentPropertiesXL") rename("ReplaceText", "ReplaceTextXL") rename("CopyFile", "CopyFileXL") no_dual_interfaces

The location is correct because I literally copy and paste the location. 该位置正确,因为我确实复制并粘贴了该位置。

However I get the error: 但是我得到了错误:

Severity Code Description Project File Line Error C1083 Cannot open type library file: 'C:\\Program Files\\Common Files\\Microsoft Shared\\office12\\mso.dll': No such file or directory 严重性代码说明项目文件行错误C1083无法打开类型库文件:'C:\\ Program Files \\ Common Files \\ Microsoft Shared \\ office12 \\ mso.dll':没有此类文件或目录

But this file or directory definitely exists. 但是此文件或目录肯定存在。 My professor said that I need administrative access, but I don't know what that means and how to change this. 我的教授说我需要管理权限,但是我不知道这意味着什么以及如何更改。 How can I fix this error? 如何解决此错误?

You did not run it as an administrator, so you cannot access folders requiring administrator access. 您没有以管理员身份运行它,因此无法访问需要管理员访问权限的文件夹。 You need to run it as admin. 您需要以管理员身份运行它。 Read more here . 在这里阅读更多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM