c# - Get the left and the top value for a excel cell -


in project, use .net library npoi create excel documents. if ms office installed, checkboxes , combobox ms interop excel dll added. because different excel sheets created different column weights, left , top values in code below should dynamic:

//top value of first checkbox double top = 68;  (int = 6; <= rowcount; i++) {     microsoft.office.interop.excel.oleobject obj2 = objs.add("forms.checkbox.1",     system.reflection.missing.value,     system.reflection.missing.value,     false,     false,     system.reflection.missing.value,     system.reflection.missing.value,     1055, //static left value     top,  //static top value     10,     10);      top += 15.43;     top -= 1.0295; }  microsoft.office.interop.excel.oleobject combobox = objs.add("forms.combobox.1",     system.reflection.missing.value,     system.reflection.missing.value,     false,     false,     system.reflection.missing.value,     system.reflection.missing.value,     1080, //static left value     27,   //static top value     50,     15); 

i have tried left , top value excel cells, can't find way that. know way these 2 values dynamically cell?

because have found no answer question. have made in way.

i have created template xls file contains vba code. code create combobox , checkboxes while worksheet start.

because of new way excel interop no longer needed. npoi creates excel sheets template.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -