Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
换句话说,我需要用 释放它Marshal.ReleaseComObject()吗?我知道Range它需要发布,但我不确定Formula.
Marshal.ReleaseComObject()
Range
Formula
在 Excel 对象模型Formula中是字符串,而不是对象。
Excel VBA 中的一个简单测试:
Sub test() Dim R As Variant Set R = Range("A1") Debug.Print TypeName(R) Debug.Print TypeName(R.Formula) End Sub
它打印:
Range String