Excel uses autofill hint "AutoFill method for class range is invalid"

Source: Internet
Author: User

Today encountered a magical problem, has been using a very good code suddenly error: "Class range AutoFill method Invalid", search on the internet, feel no one with the same situation I encountered. Debug, look at the code, found in the program, the AutoFill is specified before and after the same area. I do not know whether it is for this reason, can only manually test what the situation will produce this hint.

Wrote a test code:

Worksheet sheet = helper.getactivesheet ();                 = Sheet. cells[11];                 = Sheet. cells[31];                 = sheet. Range[b, end];                  1;                B.autofill (A, xlautofilltype.xlfillseries);

The above code can be executed successfully.

Modify the test code above to see what the situation would be to report a similar error. Modify the last line to:

                A.autofill (A, xlautofilltype.xlfillseries);

This time the code error, and I encountered a similar situation, will it be because the area A is too large to contain? Then try again and change the code to:

                B.autofill (b, xlautofilltype.xlfillseries);

Actually also reported wrong. OK, you can confirm it. Range1.autofill (range2,*), Range2 to contain Range1, two regions cannot be identical.

Excel uses autofill hint "AutoFill method for class range is invalid"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.