Knowledge.ToString()

Month: March 2017

  • Range.Sort Throws an Error Even Though Cells Are Not Merged

    Recently, we encountered an issue in our production environment where so-far-nicely-working complex spreadsheet threw an exception on Range.Sort. The error description was “to do this all merged cells should be of same size”. Unfortunately there was no merged cell and Excel was still complaining about merged cell. Finally I figured out that the range contained…

    |

  • Why TabCtrl_GetCurSel Always Returns 0?

    TabCtrl_GetCurSel returns 0 when the handler passed as a parameter is “invalid”. Here is the fix. If you are using a dialog box, you need to get the tab handler using GetDlgItem(dialog_hwnd, MY_TAB_ID); and pass that handler to TabCtrl_GetCurSel. Make sure you are using the correct variable. I faced the issue when I had two…

    |