在Visual Studio中爲我的C#winform添加interop.excel引用後,我不再能夠「編輯並繼續」....
錯誤提示「修改包含使用嵌入式互操作類型/成員的'方法'將阻止在啓用編輯並繼續時調試會話繼續 要啓用編輯並繼續,請嘗試將」嵌入互操作類型「屬性設置爲」假「調試時的COM參考」
不幸的是,當我將「Embed Interop Types」屬性設置爲「False」時,VS給我以下代碼的錯誤:
ws.Cells [2,1] .Value = xxx;
Error說「'object'不包含'Value'的定義並且沒有擴展方法'Value'接受類型'object'的第一個參數可以被找到(你是否缺少using指令或程序集參考?)「
我已經找遍了所以沒有運氣的答案...有人可以幫助嗎?Excel Interop(Visual Studio C#) - 「Embed Interop Type」屬性
5
A
回答
2
Cells()
不具有屬性Value
(Range()
有它)
變化這一行ws.Cells[2, 1]= xxx;
+0
謝謝,這工作。 –
相關問題
- 1. c#Excel Interop _Workbooks.Open
- 2. Excel C#Interop
- 3. C# - interop excel
- 4. C#。 microsoft interop excel。
- 5. C#。 microsoft interop excel
- 6. C#excel interop formula dragging
- 7. Excel Interop問題 - C#
- 8. Interop Excel UsedRange
- 9. Excel C#Interop與Excel VBA
- 10. Excel Interop XSD和XPath
- 11. 在Visual Studio中設置Embed Interop Types true和false有什麼區別?
- 12. Excel interop MissingMethodException
- 13. Excel Interop錯誤
- 14. Excel Interop C#copyRange無移位
- 15. c#Interop Excel關閉實例
- 16. Visual C#使用Excel Interop一次性設置多個單元格
- 17. .net Excel Interop
- 18. COM Interop中的.NET屬性?
- 19. 無法設置範圍類的隱藏屬性c#excel interop
- 20. Excel Interop:分組列
- 21. Excel 12 Interop HRESULT 0x800A03EC
- 22. Excel Interop - 類型未註冊
- 23. C#.net Excel Interop離開Excel過程掛
- 24. XValue propery in excel interop
- 25. Excel Interop「FindAll」方法
- 26. Howto read Range.Top in Excel interop
- 27. Excel C API相當於Interop Range.Value C#
- 28. C#Word Interop
- 29. C#Powershell Interop
- 30. C#SyncObject與Outlook Interop
類型該屬性的是* *動態,不反對。除了更改嵌入互操作類型屬性之外,您還做了其他操作。可能是因爲您忘記也將Copy Local屬性設置爲true。請不要讓我們猜測。 –