Hi everyone...
I'm back to ask the gods how can I import data from a .txt file every 2 minutes without me actually hitting refresh everytime? Is there some code that will import it or that will refresh it every 2 minutes?
Thank you for your help
Hi everyone...
I'm back to ask the gods how can I import data from a .txt file every 2 minutes without me actually hitting refresh everytime? Is there some code that will import it or that will refresh it every 2 minutes?
Thank you for your help
Re: Import Data Every 2 Minutes
Hi nightkil,
Try the Application.OnTime method in help.
Hope this helps,
Andy
Re: Import Data Every 2 Minutes
Hi Andy,
Thank you for the reply... I'm very good with this. Can point me in the right direction please.
Re: Import Data Every 2 Minutes
Hi nightkil,
How are you importing the data at the moment? If you are doing it using VBA you could just have the process repeat using .OnTime to define when.
If you give some more info on what you are doing (and how you are doing it) it will help to narrow down the options.
Cheers
Andy
Re: Import Data Every 2 Minutes
Andy,
What I did was just in the Data menu - Import External Data - Import Data. Doing it that way I was able to change the External Data Range Properties to refresh every 2 minutes but that does not seem to work... I need a macro or something that will import this text to that sheet every 2 minutes. I attached a sample of what the text file looks like and of what I need to show up on the sheet. (you can see the External Data Range Properties on the data in the spreadsheet).
Thank you
Re: Import Data Every 2 Minutes
Hi nightkil,
Sorry can't access your zip file on the work machine, so will have to talk generally.
If you are looking for a VBA solution, I would suggest you look at using ADO to connect to your datasource and pull across the data as required.
Where does your data come from (SQL Server, Access database etc..?). Once we know the source we can talk about Connection Strings for the correct provider.
A quick search for ADO produced a few posts that had specific examples you could modify.
Cheers
Andy
Re: Import Text File Every x Minutes
I put my attachments without the zip...
The data comes from a txt file... I have done Connection Strings from other excels and access but it doesn't seem to work for txt files.[hr]*[/hr] Auto Merged Post;[dl]*[/dl]Wow Dave I didn't even see your post until now...
I did try OnTime Method but I seem to be having problems with the code to import the file... Any suggestions?
Don’t have an account yet? Register yourself now and be a part of our community!