I have a datagridview in c# that I’m trying to export to excel. I’m following along with this tutorial http://www.c-sharpcorner.com/uploadfile/hrojasara/export-datagridview-to-excel-in-C-Sharp/ and I’m having some troubles. Firstly, I can’t even build it because I’m getting all of these errors (using the same code as on that website).
Warning 3 Task attempted to find "AxImp.exe" in two locations. 1) Under the "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\" processor specific directory which is generated based on SdkToolsPath 2) The x86 specific directory under "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\" which is specified by the SDKToolsPath property. You may be able to solve the problem by doing one of the following: 1) Set the "SDKToolsPath" property to the location of the Microsoft Windows SDK. MathMunchers
Warning 4 Task could not find "AxImp.exe" using the SdkToolsPath "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed MathMunchers
Warning 5 The referenced component 'Microsoft.Office.Interop.Excel' could not be found.
Warning 6 The referenced component 'Microsoft.Office.Core' could not be found.
Warning 7 The referenced component 'VBIDE' could not be found.
Reading these errors its seems like I need to have some certain stuff installed on my computer and so I’m wondering if this is even a good way to write this because I want to have this application be able to export on any windows 7 machine with excel installed.
This will only work on OS which have either Excel installed or excel libraries installed.. You need to think on alternative where Excel is not installed!