Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 导出时MS Access VBA冻结/崩溃_Excel_Vba_Ms Access - Fatal编程技术网

Excel 导出时MS Access VBA冻结/崩溃

Excel 导出时MS Access VBA冻结/崩溃,excel,vba,ms-access,Excel,Vba,Ms Access,下面几行是从用于生成XML的代码中提取的 Access 2010在执行Set dlgSaveAs行时冻结,然后崩溃。这似乎只有在使用.xls文件导入数据时才会发生,.csv似乎工作正常 看不出代码有什么问题,也看不出它为什么不能处理.xls/.xlsx文件 Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs) With dlgSaveAs .InitialFileName

下面几行是从用于生成XML的代码中提取的

Access 2010在执行Set dlgSaveAs行时冻结,然后崩溃。这似乎只有在使用.xls文件导入数据时才会发生,.csv似乎工作正常

看不出代码有什么问题,也看不出它为什么不能处理.xls/.xlsx文件

        Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)

        With dlgSaveAs
            .InitialFileName = strDate & " " & Replace(strTime, ":", "") & " " & strFFI_Filename & " XML Export" & ".xml" 'Set the default filename and directory
            .InitialView = msoFileDialogViewDetails 'Set the default folder view
            .Title = "Please provide a file name" 'Set your own dialog title
        End With

你试过做以下事情吗

With Application.FileDialog(msoFileDialogSaveAs)
        .InitialFileName = strDate & " " & Replace(strTime, ":", "") & " " & strFFI_Filename & " XML Export" & ".xml" 'Set the default filename and directory
        .InitialView = msoFileDialogViewDetails 'Set the default folder view
        .Title = "Please provide a file name" 'Set your own dialog title
End With
显然,与dlgSaveAs关联的任何其他代码都需要在带有End with的块中移动