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