Hello all,
I still cannot resolve my problem - maybe I will try to describe problem in detail.
So, I have custom ribbon with group and button.
Definition of ribbon :
<ribbon>
<tabs>
<tab id="tabCustom" insertBeforeMso="TabHome" label="My Ribbon">
<group id="groupOne" label="One">
<button id="btnFunction" image='settings32' size='large' onAction='OnFunctionButtonPressed' getLabel='GetLabel' screentip='My button tooltip' supertip='Desription my button - supertooltil ' />
</group>
</tab>
</tabs>
</ribbon>
This button is for open custom workbook, so I have custom method for handle click button action :
public void OnFunctionButtonPressed(IRibbonControl control)
{
var openFileDialog = new OpenFileDialog() ;
openFileDialog.Multiselect = false;
openFileDialog.Filter = "Typical Files(*.xls;*.xlsx;*.xlsm)|*.xls;*.xlsx;*.xlsm|All files (*.*)|*.*";
var res = openFileDialog.ShowDialog();
if (res == DialogResult.OK)
{
MessageBox.Show(string.Format("{0} {1}", "File to open:", openFileDialog.FileName));
//do somethink to open workbook
}
else
{
MessageBox.Show("Canceled..");
}
}
Normally all working fine, but if user have enabled preview pane in windows explorer (see screen in attachment), after selecting xlsx file Excel neither freeze or crashes. I suppose that the same instance of Excel is used to preview.. so it could be problem, but have not idea how to resolve it (except disable preview by wrapping OpenFileDialog - I want to avoid it)
Please help and write any suggestion
Regards,
Sebastian
W dniu środa, 21 października 2015 13:56:39 UTC+2 użytkownik Sebastian napisał:
Hello All, Hello Goovert
I got stuck on some strange problem.
In my Excel DNA add-in I have to allow user to open some worksheet, so I have implemented OpenFile dialog. All working fine, but when if during opening xlsx file user enable and use Previev Pane in Windows Explorer and next will open worksheet all Excel freeze and thread deadlock is reported.
Anyone had similar problem ?
Please help
Best Regards,
Sebastian