+ Reply to Thread
Results 1 to 27 of 27

Auto Refresh The excel every 1 second

  1. #1
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Auto Refresh The excel every 1 second

    I am very newbie to VBA. I have an macro enabled workbook in which the data is updated in cell B4, B5, B6, B7 & B8 from another excel which is in network drive.
    I want this excel named as "TOKEN" to get refresh automatically after every 1 second. Below I have attached the excel file for further help & undersatnding.
    Anyones help would be apprecaited. Thanks a lot in advance.

    Regards
    RAJ
    Attached Files Attached Files

  2. #2
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    Try this.
    Paste the CODE 1 in ThisWorkbook Module in VB Window.
    CODE 1 :-
    Please Login or Register  to view this content.
    Paste CODE 2 by inserting a new Module.
    CODE 2 :-
    Please Login or Register  to view this content.
    Save the Workbook and Then Restart it and tell if it works or not.
    Last edited by Vikas_Gautam; 02-06-2015 at 02:54 AM.
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  3. #3
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Hi Vikas,

    I tried pasting your code after that I closed the workbook & I tried to open it again but I was not able to do so.
    Its showing compile error. As I am new to VBA so sorry to ask this But the code provided by you will it refresh the excel every 1 second.
    Because that what I am looking for.

    Regards,
    Raj.

  4. #4
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Thumbs up Re: Auto Refresh The excel every 1 second

    Its working for me..
    Check the attached file:-
    Attached Files Attached Files
    Last edited by Vikas_Gautam; 02-06-2015 at 03:08 AM.

  5. #5
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Hi Gautam,

    Your excel is working fine. It's getting refreshed every second. But the problem is its not updating the data from other excel which is in network drive.

    I am using the Data Connection Wizard by using "Importing External Data" to pull data from a database. This works very well. However, the only option available is a refresh every 60 seconds.

    I was wondering if there is a script that I could code into Excel to force a refresh every "x" seconds. I need the refresh to be even shorter than 60 seconds preferable every 2 seconds.

    Regards,
    RAJ

  6. #6
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    I have the change the following code:-
    Please Login or Register  to view this content.
    Check the attached file and tell if that is working for you.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Hi Gautam,

    Is showing RUN TIME ERROR '1004'

    When I first open only your sheet it works fine but when I open the network sheet from which the data is suppose to be exactly taken.
    It shows the above mentioned error. Both the sheets should work parallely. The sheet send by you will be the main display sheet. So it should get refresh automatically.
    The other sheet will be the sharing sheet which will be in network shared by four operators. The main purpose of this whole concept is to make a "TOKEN SYSTEM".
    Where the four operators will update the token number in their sharing sheet & the moment they update the token number in their sharing sheet it should get displayed in the main sheet wich is connected to the big display TV. As of now I am already using this system & its woking very fine but the problem is the moment the operator updates the number in the sharing sheet it gets updates in the main display sheet after a minute. I want this to happen instantly.

    With Regards
    Raj

  8. #8
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Hi Gautam,

    I am really sorry to ask this .. but I am not able to find the attach option over here.

    Regards,
    Raj

  9. #9
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    Attachment 149278

  10. #10
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Error.jpg

    pls check the attach file.

  11. #11
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Token is the file which will be used for main display.
    Token shared is the shared file which is used by operators to type the token numbers.
    Once the number typed in token shared file the number should instantly reflect in token file.
    Token file is in display computer & token shared file is in network drive.

    With Regards,
    Raj.
    Attached Files Attached Files
    Last edited by rp301987; 02-09-2015 at 03:33 AM.

  12. #12
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    I have been successful in doing what you are saying..

    Here is the attached file:-
    Token.xlsm

    This the file which will be opened all computers. I mean you server and other as well.
    So best if u place it in the network drive. and open it in all the computers.
    The changes made on any computer will be reflected on others as well.

    If It works for you then I will be telling you How I made it.
    Last edited by Vikas_Gautam; 02-09-2015 at 04:46 AM.

  13. #13
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Hi Gautam,

    When I am clicking the attachment I am getting following error.

    Invalid Attachment specified. If you followed a valid link, please notify the administrator.

    Regards,

    Raj

  14. #14
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    Sorry here is the attached file..

    Edit:- I have corrected the attachment in the Post #12 as well.
    Attached Files Attached Files
    Last edited by Vikas_Gautam; 02-09-2015 at 04:47 AM.

  15. #15
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Hi Gautam,

    I am just little confused. Do you want to say there is no need of two different excel. Only this one file will do.

    Regards,

    Raj.

  16. #16
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    Yes.. That what I mean..
    There is no need of two workbooks. This one will do.

    Is it working for you...?

  17. #17
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    Duplicate post.....
    Last edited by Vikas_Gautam; 02-09-2015 at 08:26 AM.

  18. #18
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    Okay..
    1. Download the following file in a folder share on network.
    2. Open the file. Disable Macro for the time being.
    3. Click Share Workbook option in the Review Tab.
    4. Check the "Allow changes by more than one user" option under Editing Tab.
    5. Now switch to Advanced Tab, Check the "The Changes being saved win" option under the "Conflicting changes between users" heading.
    6. Click Ok.
    7. Excel will ask you to save the file. So click Ok. And a Macro warning would be shown, click OK in that as well.
    8. Close the file by saving it.
    9. Now try to open this file on all computers of your network. And try changing the cell value and tell if it changes on all computer or not.

    While I am writing these steps, I am performing them as well. and its working fine for me.

    Here is the attached file:-
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Hi Gautam,

    I followed the procedure as said above by you. but I am really sorry its not successed.
    Pls find the attached file for error which I am getting.

    With Regards,
    Raj
    Attached Images Attached Images

  20. #20
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    Its quite unfortunate RP.
    The both file were working and updating simultaneously each other when I used it on My PCs.
    I have used Excel 2007 for my testing and PCs having XP installed on them.
    I try to google and search what can be reasons for such in consistency.

    Have a look at following links in which this inconsistency has been addressed.
    http://support.microsoft.com/kb/129276

    One more question, how much time does it take to save file on your PCs, as on my PCs it was quite quick.
    I just want to cover the possibility that if it takes too long to save file on your PCs then it can lead to File is locked error.

    Reconsider the attached file with all steps given in Post #18.
    I have changed the interval from 1 second to 2 seconds.
    Attached Files Attached Files
    Last edited by Vikas_Gautam; 02-09-2015 at 03:34 PM.

  21. #21
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Hi Gautam,

    Good Morning. I am windows 7 on my all Pcs. The files were getting saved quickly but it were not reflecting in other PCs.
    The excel file which you have used it was macro enabled file or it was a simple 2007 excel.
    I tried the same with new excel but still its same problem.
    Just send me the macro codes & where its suppose to be placed. With the time duration of 1 second.
    I will try to create a new excel over here itself & will see whether it works or not.

    With Regards,
    Raj.
    Last edited by rp301987; 02-10-2015 at 12:54 AM.

  22. #22
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    Here are the macros:-

    Place it in the ThisWorkbook Module
    Please Login or Register  to view this content.
    Place it by inserting a new module:-
    Please Login or Register  to view this content.
    You can change seconds by changing the red bold portion. I guess, The On Error Statement can do the job here..

    The file containing the code is attached. Open it. It will ask you to enable macros. Disable them. Press Alt + F11. You will find the codes there.
    Attached Files Attached Files
    Last edited by Vikas_Gautam; 02-10-2015 at 02:17 AM.

  23. #23
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Hi Gautam

    Are these the new codes what you have given to me. I should try them with old procedure what you have given me.

    Regards,

    Raj.

  24. #24
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    Yes. Exactly..
    Try them will old procedure..!
    I think we are very close..

  25. #25
    Registered User
    Join Date
    11-22-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    17

    Re: Auto Refresh The excel every 1 second

    Hi Gautam,

    This is working but partially. Now is not showing run time error but, its still showing second error i.e the file is locked.
    and its also taking some time to update it.

    I THINK WE ARE VERY NEAR TO CRACK THIS THING.

    Regards,

    Raj.
    Last edited by rp301987; 02-10-2015 at 04:04 AM.

  26. #26
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    On how many computers are running the file...?

  27. #27
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Auto Refresh The excel every 1 second

    Finally, I have made it possible.

    Here are the steps you have to follow.
    1. In the Shared workbook, use the following code. You have to first Unshare it and then paste the code and then reshare it with the steps I told you earlier.

    Please Login or Register  to view this content.
    2. Now open your Main display worksheet ( a normal worksheet not a shared one.)
    3. Link the cells, which you want to update by simultaneously opening the Share Workbook.
    4. After linking it, close the Shared Workbook. But keep the Main Display sheet open.
    5. Now in the Opened workbook, Press Alt + F11. In the ThisWorkbook Module Paste the code below:-

    Please Login or Register  to view this content.
    6. Now Insert a module and Paste the code below in it.

    Please Login or Register  to view this content.
    8. Save the workbook as Macro Enabled one.
    9. Now open it by enabling macros and Open the Shared Workbook on other PCs.
    10. Update values on Shared Workbooks and See if it updates on Main Display workbook.
    and One more thing, this working for me.

    Note:- Linking means to Refer cells in other opened workbooks.
    Last edited by Vikas_Gautam; 02-16-2015 at 08:02 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Auto-refresh external data in Excel 2010
    By globulous in forum Excel General
    Replies: 1
    Last Post: 12-30-2014, 03:24 AM
  2. auto refresh in excel 2007
    By eLement23 in forum Excel General
    Replies: 0
    Last Post: 01-19-2012, 05:00 PM
  3. Auto refresh every 5 seconds in Excel
    By pritzdk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2011, 06:55 AM
  4. Enable Auto Refresh - Wait for refresh to sinish before running a macro
    By tomlancaster in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2011, 11:52 AM
  5. Auto Refresh of Shared Excel File
    By majorkumar in forum Excel General
    Replies: 0
    Last Post: 03-05-2009, 03:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1