简体   繁体   中英

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

I am trying to visualize my experimental data in 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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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