+ Reply to Thread
Results 1 to 2 of 2

Problem with Code

  1. #1
    Registered User
    Join Date
    10-26-2011
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    2

    Problem with Code

    Hi, let me start off by saying by saying that I know pretty much nothing about how to do this. I know enough to figure most things out but to start from scratch not so much.

    As a note I am using Excel 97. Saving the file as .xls

    The problem I am having is I am running a web query which is this:

    http://72.95.125.72/cgi-bin/schoolcl...-clinton-essex

    This works perfectly fine. What I was trying to accomplish was to set up an autosave in VB in a model which is this:

    Option Explicit
    Public RunTime

    Sub StartTimer()
    RunTime = Now + #12:01:05 AM#
    Application.OnTime RunTime, "SaveBook", schedule:=True
    End Sub


    Sub SaveBook()
    ActiveWorkbook.Save
    StartTimer
    End Sub


    Sub StopTimer()
    On Error Resume Next
    Application.OnTime RunTime, "SaveBook", schedule:=False
    End Sub



    In the workbook is this:

    Private Sub Workbook_BeforeClose(Cancel As Boolean)

    StopTimer

    End Sub

    Private Sub Workbook_Open()

    StartTimer

    End Sub


    This seems to work fine as well. It automatically overwrites the files which is great.

    This is the problem that seems to occur and it is totally random. Every once in a while a pop up will come up and say "This action will cancel a pending refresh data command. Continue."

    It basically stops every thing until I hit ok and then it is fine.

    What I need it to do is read the web query every minute and autosave every minute or two minutes. Is there away to do this without running into any errors.

    Thanks
    Shaun

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Problem with Code

    Hi, and welcome to the forum! Unfortunately:

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    also:

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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