Some ideas about MFC's operation of Excel

Source: Internet
Author: User

First, when operating multiple sheet, remember to select the sheet to be operated before the operation
If you copy the contents of range (A1:an) within Sheet1 to Sheet2, "the Select method for class range is invalid"
Available in range. Select (); Front plus sheet. Activate ();
Second, when using Cfilediadlg to open multiple files, remember to set the file name cache
CFileDialog built-in file name cache length is only 200, but many times, the path of the file is much larger than this number, for the sake of insurance, to set a file name cache.
dlgFile.m_ofn.nMaxFile = * MAX_PATH;
Three, a different angle, borrowed from Excel blank cells and Excel self-function to simplify the operation
For a chestnut, to read the cell contents of a date format in Excel, if you read it directly, write to the edit control, and a string of strange numbers will appear:

At this point, we can change the angle, first borrow the blank cell in Excel, with Excel itself function =text (ak2,\ "Yyyy-mm-dd hh:mm:ss\") for format conversion. Then read the contents of this cell to display, it is very pleasant ~

White says: Look for a new angle~

Some ideas about MFC's operation of Excel

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.