Neglect empty cells while refreshing
- by Ashok Vardhan
I have an excel macro which refreshes the worksheet.
However, if the file (in .csv format) with which the worksheet is being refreshed has empty cells, it's shifting the data from other columns and placing the data in wrong columns.
However,if I manually refresh the sheet, it's working fine. I don't know how I can fix this.
I just want my whole .csv file including empty cells to appear as it is in the worksheet.
Any suggestions would be greatly helpful.
The following is the Macro code.
With Worksheets("RawData1").QueryTables(1)
.TextFilePromptOnRefresh = False
.RefreshStyle = xlinsertdelete
.Connection = Application.Substitute(.Connection, CurrPath, NewPath)
.Refresh
End With
// We can assume that we have CurrPath and NewPath properly