ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel crash when doing OpenXML, apparently involving DisplayAlerts (https://www.excelbanter.com/excel-programming/386555-excel-crash-when-doing-openxml-apparently-involving-displayalerts.html)

[email protected]

Excel crash when doing OpenXML, apparently involving DisplayAlerts
 
Hello,

I have workbook that crashes when I do an OpenXML on an XML file.
(This must be run under Excel 2003 Professional for that to work). I
spotted this on a big ugly excel file, but fortunately, I can make it
crash on a much simpler workbook, consisting of just the following:

1. the following 5-line macro:

Sub RunTest()
Application.DisplayAlerts = False 'turn off warnings only when
reading XML
Workbooks.OpenXML Filename:="test.xml",
LoadOption:=xlXmlLoadImportToList
Application.DisplayAlerts = True
End Sub

and

2. A blank sheet with a button to call RunTest().


Now, the reason I am saying DisplayAlerts have something to do with
the crash is because when I comment out the DisplayAlerts lines the
macro runs just fine. I do get an alert box having to do with an
import warning, which is why I put the DisplayAlerts there in the
first place.

So my question out there is: does anyone know if there is a known
issue with setting DisplayAlerts issue to false????

I don't expect anyone out there to fix this, but I'd like to know if
anyone out there knows about the issue. I can't find anything on any
of the microsoft web pages or forums. But I don't want to burn an
incident on this, just in case there's a tech note that I missed that
explains the situation.

Thanks,

Joe

(p.s. if you're curious about test.xml, it's about 200k and I will
spare you the contents. It's a straight dump from the output of an SQL
query to MS SQL that uses the FOR XML clause).



All times are GMT +1. The time now is 04:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com