-
-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Range.Columns property error encountered after upgrading to new version of exceldna #705
Comments
I tried it again just now and found that the root cause of this problem seems to be not only the Columns attribute, but also the index of the range. Currently, running the above code can indeed obtain an object, but this object is not a valid range object, and attributes such as .count or .address cannot be obtained from it. In addition, now I get a range object directly and an error will be reported: |
I wrote an example in the attachment that more directly reflects the root cause of the problem. Please help me take a look:
|
I tested it many times and finally found a way to get the specified range items normally. If you directly use chain calls or implicit definitions, you will not be able to obtain the corresponding attributes normally: I don't know why this happens when I use the new version of exceldna library in my new project. I didn't encounter this problem in the old project. |
The same is true for range.Worksheet.Parent.Name, and chain calls cannot be made. I don’t know if there’s something wrong with my usage, or if it’s just like this in the new version. |
ClassLibrary1_vb_testRange.zip
I recently encountered a problem using the latest version
When the range object uses the Columns attribute, it cannot be used normally.
Range.Columns Property (Microsoft.Office.Interop.Excel) | Microsoft Learn
I used to use "rangeObj.Columns(1)" to get the first column of data in the range, but now when I use the same code, an exception occurs: "System.MissingMemberException"
Previously the following code worked fine:
dim result = rangeObj.Columns(1).value
Now i can only:
Dim temp = rangeObj.Columns(1)
dim result = temp.value
This problem feels very strange to me. This is the only problem I have left after upgrading to the new version. Please help me confirm the reason.
I've attached the project I used. Excel input during debugging:
The text was updated successfully, but these errors were encountered: