PowerQuery Text File Extraction - Set to Ask for File name on Refresh?

dls0406

New Member
Joined
Oct 7, 2019
Messages
14
Disclaimer - I am a new user.

I have created a powerquery that pulls in a text file and performs several formatting steps before close&load to an excel file. The problem is, that each month, I need to change the text file that is being pulled into the powerquery. (The file is emailed to me from an external source). Now, I know I can manually edit the query source and select a new source each month. However, I was wondering if it was possible to have excel ask for a new file each time I hit "refresh"?


I see that if I use legacy text import, I can do this, but I dont see an option when I use regular text import. And if I use the legacy text import, then I cant seem to figure out how to make the formatting changes within the same query. Any Ideas?
1579103670791.png
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,762
maybe try From Folder option
in this folder replace old text file with new then refresh query
 

dls0406

New Member
Joined
Oct 7, 2019
Messages
14
I guess there is no way to re-promt each time? I am not the exclusive user of these files and the locations where they are saved, so it would make more sense from my standpoint if I did not have to create new folders. Though if thats the only way it may be a use-able work-around
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,762
create ONE folder where you put text file
in the SAME folder replace old text file with new

you need only re-create your query to this option: Data-New Query-From File-From Folder once
then after change text file in this folder - refresh query (every time if text file will be changed)
 
Last edited:

dls0406

New Member
Joined
Oct 7, 2019
Messages
14
Yes I understood what you meant, which may be a decent workaround if it is impossible to do what I had hoped. Thanks for your help!
 

Forum statistics

Threads
1,081,716
Messages
5,360,819
Members
400,600
Latest member
Stuckagainandagain

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top