Excel在Excel插件中使用Windows资源管理器中的预览窗格时崩溃或冻结 [英] Excel Crashes or freeze when preview pane in Windows Explorer is used in DNA addin

查看:224
本文介绍了Excel在Excel插件中使用Windows资源管理器中的预览窗格时崩溃或冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的Excel DNA加载项中,我必须允许用户打开一些工作表,所以我已经实现了OpenFile对话框。 所有工作正常,但如果在打开xlsx文件时用户启用并在Windows资源管理器中使用Previev窗格,接下来将打开工作表所有
Excel崩溃的冻结。

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 crashes of freeze.

OnFunctionButtonPressed'  getLabel =" GetLabel"  screentip ='我的按钮工具提示'supertip ='Desription my button - supertooltil'/>

        < / group>



      < / tab>

    < / tabs>

  < / ribbon>



此按钮用于打开自定义工作簿,因此我有自定义方法来处理点击按钮操作:


$
  public void OnFunctionButtonPressed( IRibbonControl control)

        {

            var openFileDialog = new OpenFileDialog();

            openFileDialog.Multiselect = false;

            openFileDialog.Filter ="典型文件(* .xls; * .xlsx; * .xlsm)| *。 xls; * .xlsx; * .xlsm |所有文件(*。*)| *。*" ; $
           

            var res = openFileDialog.ShowDialog();
$


            if(res == DialogResult.OK)

            {

                MessageBox.Show(string.Format(" {0} {1}"," File to open:",openFileDialog.FileName));

     ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; //做一些打开工作簿的想法


            }
           否则为
            {

                MessageBox.Show(" Cancelled ..");

            }
        }
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..");
            }
        }

推荐答案

塞巴斯蒂安,b

Hi Sebastian,

>>但是如果在打开xlsx文件时用户启用并在Windows资源管理器中使用Previev窗格,那么将打开工作表所有Excel崩溃的冻结。

>> but when if during opening xlsx file user enable and use Previev Pane in Windows Explorer and next will open worksheet all Excel crashes of freeze.

我不确定你的步骤是什么。您何时启用预览窗格?对于以后的帖子,如果启用预览窗格,然后打开excel文件,它就不会冻结。您是否在Windows资源管理器中启用预览窗格或在OpenFileDialog
窗口中启用预览窗格?

I am not sure what your steps are. When did you enable Preview pane? With your later posts, if you enable preview pane, then open excel file, it would not freeze. Did you enable preview pane with windows explorer or enable preview pane in the OpenFileDialog window?

我使用您的代码和步骤进行了测试在下面,它工作正常。

1.单击按钮打开OpenFileDialog窗口

2.在OpenFileDialog窗口中单击"显示预览窗格"

3.单击要打开的文件

I made a test with your code and steps as below, it worked correctly.
1. Click button to open OpenFileDialog window
2. Click "Show the Preview pane" in OpenFileDialog window
3. Click the file to open

注意,我在VS2013,Office 2013和Windows 10下测试。

Note, I test under VS2013, Office 2013 and Windows 10.

如果您能分享我们的详细步骤以重现您的问题,将会很有帮助。

It would be helpful if you could share us your details steps to reproduce your issue.

最好的问候,

Best Regards,

Edward


这篇关于Excel在Excel插件中使用Windows资源管理器中的预览窗格时崩溃或冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆