Forum Discussion
cindy_lu
Sep 15, 2022Copper Contributor
VBA: How to read very very big csv file into excel quickly without excel's auto formatting?
When I use `Workbooks.open` method to open the csv file I want to use, it takes me 30 seconds. However, Excel foramtted the data automatically during file opening. It formats some values like date, ...
cindy_lu
Sep 15, 2022Copper Contributor
Thanks for the suggestion.
However, this function is only one small part of the automation process I wrote in VBA.
Also, I don't need any other flexibility this time 😄
Or do you mean that I can start the Power Query then load all the data by VBA automatically?
However, this function is only one small part of the automation process I wrote in VBA.
Also, I don't need any other flexibility this time 😄
Or do you mean that I can start the Power Query then load all the data by VBA automatically?
Martin_Weiss
Sep 16, 2022Bronze Contributor
Hi cindy_lu
yes, that's what I meant. Create a new query/connection with Power Query and load the data once. And after that, you can trigger the next import from VBA:
Either with
ActiveWorkbook.Connections("Name of your query/connection").Refresh
or
ActiveWorkbook.RefreshAll