0

我在 c# 中有一个 datagridview,我正在尝试导出到 excel。我正在关注本教程http://www.c-sharpcorner.com/uploadfile/hrojasara/export-datagridview-to-excel-in-C-Sharp/我遇到了一些麻烦。首先,我什至无法构建它,因为我遇到了所有这些错误(使用与该网站上相同的代码)。

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. 

阅读这些错误似乎我需要在我的计算机上安装一些某些东西,所以我想知道这是否是编写这个的好方法,因为我希望这个应用程序能够在任何 Windows 7 机器上导出安装了excel。

4

1 回答 1

0

这仅适用于安装了 Excel 或安装了 Excel 库的操作系统。您需要考虑未安装 Excel 的替代方案!

于 2012-12-02T07:33:15.197 回答