I created an Excel file that imports text files from my local c drive.
The file is only around 225 kb in size. You think opening this file should take a few seconds to open but takes almost 2 minutes.
No other Excel file has this problem except this one.
Could it be the VBA Code below??
When I open VBA "View Code" I noticed there are now 2 identical duplicate "projects" listed in the left pane.
Any idea why this file takes so long to open??
Thank you in advance!!
Sub DataImportMD5x2()
Sname1 = Sheets("CopyPaste").Range("L11").Value
Path = Sheets("CopyPaste").Range("L1").Value
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & Path & Sname1 & "", Destination _
:=Range("$B$1"))
.Name = "Draws_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Range("B3").Select
Application.Run "Bright5Reports.xlsm!CopyReportsMD5"
Sheets("CopyPaste").Select
Range("B3").Select
End Sub
The file is only around 225 kb in size. You think opening this file should take a few seconds to open but takes almost 2 minutes.
No other Excel file has this problem except this one.
Could it be the VBA Code below??
When I open VBA "View Code" I noticed there are now 2 identical duplicate "projects" listed in the left pane.
Any idea why this file takes so long to open??
Thank you in advance!!
Sub DataImportMD5x2()
Sname1 = Sheets("CopyPaste").Range("L11").Value
Path = Sheets("CopyPaste").Range("L1").Value
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & Path & Sname1 & "", Destination _
:=Range("$B$1"))
.Name = "Draws_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Range("B3").Select
Application.Run "Bright5Reports.xlsm!CopyReportsMD5"
Sheets("CopyPaste").Select
Range("B3").Select
End Sub