I want to import excel driver in c++ using ExcelImport.cpp file but the visual studio is unable to open my file. I am giving the directory of my c folder but the visual studio is looking in its directory folder. I already include my path in additional directories but it's not working I want to write results in an excel file. Here are my include paths and the error list.
I want to do the same exactly that is followed by under this link but in my case the imports are not working
ExcelImports.cpp
#import "C:\Program Files\Microsoft Office 15\root\VFS\ProgramFilesCommonX86\Microsoft Shared\OFFICE15\MSO.DLL"
#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"
MyfunctionCode.cpp
double GetDoubleFromCell(Excel::_WorksheetPtr sheet, CComBSTR cell)
{
Excel::RangePtr range=sheet->GetRange(CComVariant(cell));
_variant_t value=range->GetValue2();
return value;
}
I am trying to import MSO.dll file but it is importing MSO.tlh
output Window :
Build started...
1>------ Build started: Project: ExcelVisualisation, Configuration: Debug Win32 ------
1>MSVCRTD.lib(exe_main.obj) : error LNK2019: unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
1>E:\Hamza ku\Tuition C++\Level9\Level9Code\Level9Code\Projects\ExcelVisualisation\Debug\ExcelVisualisation.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "ExcelVisualisation.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========