hi All,
I loaded and transformed the .txt file to excel using power query. all works.
Now I would like to write a macro that would allow me to choose the .txt file I want to load. this is easy, I use the code:
vFile = Application.GetOpenFilename("text-files,*.txt", _
1, "Select One File To Open", , False)
and then use vFile as source file for my Power Query conversion steps. this needs the powerquery connection to be changed into vFile - but how???
I was trying to edit somehow the PQ --> Data Source Settings --> change source --> browse, with VBA but I am getting error each time.
What I want to achieve - to have a button "load data" with linked macro, that will load the txt file I choose and then transform it as per my poser query steps. as a result I get the refreshed table in excel.
I would be grateful for any help
BR
Draszor
I loaded and transformed the .txt file to excel using power query. all works.
Now I would like to write a macro that would allow me to choose the .txt file I want to load. this is easy, I use the code:
vFile = Application.GetOpenFilename("text-files,*.txt", _
1, "Select One File To Open", , False)
and then use vFile as source file for my Power Query conversion steps. this needs the powerquery connection to be changed into vFile - but how???
I was trying to edit somehow the PQ --> Data Source Settings --> change source --> browse, with VBA but I am getting error each time.
What I want to achieve - to have a button "load data" with linked macro, that will load the txt file I choose and then transform it as per my poser query steps. as a result I get the refreshed table in excel.
I would be grateful for any help
BR
Draszor