+ Reply to Thread
Results 1 to 14 of 14

Maintain & update an Error log .txt

  1. #1
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Wink Maintain & update an Error log .txt

    Hi,

    I have tried doing this a few times, & Im gonna try again soon; its the next project on my horizon. I am reaching out to you guys cause I was hoping that someone had some sample code from a project they did. So I could get an idea as to how it should be done.
    Or maybe share a link that might get me going in the right direction.


    TIA

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Maintain & update an Error log .txt

    An error log could mean a lot of things. What is it that you mean?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: Maintain & update an Error log .txt

    Hi,

    I am just writing some output to a text file.
    The problem I am having is maintaining it 24/7. If there is no Errors/Output the folder doest exist, so I create it. If its older than 7 days old I archive it in a folder.
    So it may or may not be there, but if it is I want to write to it.

    Your question has helped me understand more clearly what I am trying to do: Is structure a test to look for a folder on C:\Errorz
    if its not there create it & if it is write to the file named:“ErrorEvents” 3/19/2015 10.58.24 AM
    ErrorEvents [Date]
    The problem I have. Is if an Error arose or the problem where to persist to happen write to the folder/file & then to dump it to the archive folder, if its older than a week old. This is where I start getting lost. I don’t know sadly Im not an IT dude, so I have no clue. I also have nobody else to query outside of Google & well since I have been brave enough to post here you guys. I apologize. I feel like this should be easy, but I get lost. I just thought that some of you guys who do this for a living would have some broiler plate for something similar to what I tried to describe.
    It all just simple logic, but sadly I am lacking in that department.

    Thx for asking Jeff, & BTW that was a lightning fast reply. FastestEver that I have received thx for that. +1 LightningRelpy. I know you guy dont do what you do for RepPoints you do it to help & its the least someone could do to acknowledge your time & effort. Thats why I hit you guys with them all the time for silly stuff. Its the most I can do to return the favor.

    lol & yes it did take me over an hour to craft that response, not all of it, but yeah.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Maintain & update an Error log .txt

    But what kind of errors are you talking about? I am still not seeing how this relates to Excel. You can do all the file manipulation in VBA but that logic has to be integrated into the process that is detecting and recording the errors.

  5. #5
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: Maintain & update an Error log .txt

    Hi,

    Well its a rather large project & it does a lot of things, but one of the errors that I want to capture is when IE crashes or if an object isnt available when my code runs. All of the errors go to my error handler which is a CaseStatement so I can handle known errors & catalog unknown errors. Then I can make the time to fix these things as the come along.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: Maintain & update an Error log .txt

    Ah, here we go I have a more definitive question now. At least I think?

    How does one deal with after midnight. Like in my backward world today is Fri. & will be till I goto bed & wakeup. So while in reality it might be 2:AM Sat, but to me its still Friday night till I wake up the next day.

    Okay maybe thats a bad example how would I do something like if I want days to run on my time everyNew day Starts @ 7:AM.
    yeah so its Monday till Tuesday @ 7:AM.

    Please Login or Register  to view this content.
    you see the problem with what Im doing here right, after midnight it becomes false, but its still the same day [To me] & so I want it to be to my code.
    I don’t want to completely destroy time just I want something to happen @ different times of the day & sometimes a day could be a variable. Huh?
    Last edited by dlow; 03-27-2015 at 01:56 PM.

  7. #7
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: Maintain & update an Error log .txt

    Well nobody has even checked to see if they could help I guess nobody cares about my problems getting Solved but me.
    Thats not true my view count did go up +2 lolz

    I dont ask questions to solve them myself [notSaying you didnt help Jeff] I just cant wait 2 & 3 days for answers, hey I know Im @ the mercy of the community’s generosity. I get it

    Anyway this is what I have come up with for now as a Step in my final resolution. Seems to work, but it feels wrong like theres gotta be a better way.
    Please Login or Register  to view this content.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Maintain & update an Error log .txt

    I still have this on my watch list, but honestly this forum is not a job for me, just something I do for free when I have extra time. The reason I have not put more effort into this is that this is a pretty specific question that would not be of broad general interest, and I don't have a solution already developed I can hand off to you. So I would have to spend a bunch of time building something from scratch just for you, which is kind of like consulting. It's not a matter of generosity....

    You may want to consider posting this in our Commercial Services forum, and offering to pay someone to do it. I would suggest 20 points as a good start (would cost you $20, the person would get $15 of that).

  9. #9
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: Maintain & update an Error log .txt

    Yeah I got that & I hope that you nor anybody else would take it like that what I was saying is that: I hope that people arent getting pissedOff that I ask a question & then answer it. Thats all.

    Thanks for the info about the paid service. I will have to consider it someday. Whats 20 bucks right when it takes me hours & days to do this, but the caveat is that I am no better for the experience. I want to learn & do.

  10. #10
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: Maintain & update an Error log .txt

    Also I am unclear of the rules of engagement here.
    I would have put this question that I asked today in its own thread in the Macro section but didnt want to get in trouble. I have done it before & backelinked but the whole time worried, was that the right thing to do oh..... ect.
    I have read the rules but seem to inadvertently break them. Just today I was reprimanded for editing a post. 1st off I didnt even remember reading it as a rule & I dont see looking @ the times how I did break the rule, & futher I dont even really care; Im not making issue with that. All of that is just to explain why I couldnt put the following into my prior post.

    Its a paradox while it would be nice to have someone write beautiful code for me like HaHoBe did in that post. That doesnt really help me [or in my own mind the person asking].
    I want to own the information. I could have paid someone to type a memo, but I would never have learned to type. I have been searching Google for years finding answers through reverse engineering someone else’s code & getting it to fit my purpose. You know what thats really not the best way to learn. Its a BIG waste of time, though it does serve its purpose, it gets old & its an arduous task.
    Aside from that I have paid subscriptions to Lynda.com & bought Excel /VBA books & am put in a sincere effort to learn, but like I said before doing in isolation is very difficult. When you cant ask a simple question to someone. While I admit as a novice what night seem like a simple question at 1st glance its might not be to some who knows the intricacies. I am learning that to all problems VBA are just like any other problem, they can be solve if you break them down to the smallest or most immediate problem.
    lol in my prior post I did explicitly said
    notSaying you didnt help Jeff
    . & you still choose to lay down the law with me. I was really tip toeing there yet you still found offence. In your earlier comment you asked me questions which got me thinking & brought about some resolution & direction. So maybe take it down a notch, I meant when I said thanks. I don’t know maybe today is one of days for you. Regardless I did asked a question in [this] post about what I was doing & how I was doing that seems pretty general to me. You know what this is all really silly. You had an opportunity to say yeah that’s good or nah that’s not, but you want to tell me about the pay service. You guys do realize that you don’t know who is who. Yeah you might have some digital info on my machine & local, but cant that be spoofed? Sure it can. So I could if I were some kinda jerk create a bunch of user accounts & ask a bunch of questions & get my work done faster [evilGrin], sure I could. Thats not what I am trying to do here I am trying to be a member of the community. So let’s all play nice, I have so much respect & admiration for many of you here [Jeff]. Im also not trying to make anyone answer me. I just don’t understand why if you have no real intention of helping would you respond.
    Non of this really matters Im just another crazy on the internet. I don’t know how this forum is but I used to Mod on a forum & we Banned them all day long everybody has their own agenda. I only mention that because I am trying to be a straight shooter here. Without a paid wall you cant block, ban, or ignore anybody. Im not trying to go there. I like my username & my content I have made a few freinds here as-well. But the bottom line is you can ignore someone, & ban them but that won’t stop them from getting their information.The only power we have is percived.
    I just want someone to point me in the right direction, & if I’m doing something wrong to tell me.
    We all have different circumstances. Some of us were not afforded the same opportunities in life. If you a born to irresponsible parents or even a family of misfortune. Well that’s not your fault, but it is if you don’t break the cycle.
    I try to joke & have fun, but it doesn’t always translate well in text. So if you’re offended by me you’re probably taking yourself too seriously.
    ~ I get Knocked Down, but Ill get up again. ~

  11. #11
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: Maintain & update an Error log .txt

    Just close this thread there will be no future resolution on this issue thx any way. I dont care to know anymore I can & will work it out by myself & if that fails I will just be another user from another country on another forum with all new credentials. GetIt? Doubt it. Hahah who knows

  12. #12
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Maintain & update an Error log .txt

    Assuming you have MS Office, would you consider using MS Access as the destination for your error log?

    For one of the projects I wrote, I use a line of code to print all errors, known or not (my Select Case just gives differing feedback, depending on if I anticipated the error) to an Access database file that contains nothing but a log of the errors.

    Mine keeps records back all the way back to when I was developing, and since Access tables were designed to handle lots of data, the file size is miniscule.


    Please Login or Register  to view this content.
    This code captures a timestamp, the username of the person logged into the computer at the time of error, the error number, and error description and instantly prints them to my error log.
    The end users don't even know it exists. In the event they come across an error that they're sure isn't their fault, I have a full log of the who/what/where/when. You can even go further and capture computer serial, actual range data from Excel. So much.
    Last edited by daffodil11; 03-27-2015 at 08:07 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  13. #13
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Maintain & update an Error log .txt

    Quote Originally Posted by dlow View Post
    Also I am unclear of the rules of engagement here.
    I didn't look at the post where you were reprimanded for editing. There's nothing wrong with editing, but we ask that you not edit a post after someone has replied to it, so that it no longer makes sense to someone who comes along to read the thread. I have no idea if that's what happened--but other than that you should be able to edit to your heart's content.

    I didn't mean to come across negatively. I just meant to say that you have a problem that may take a lot of time to solve and I'm not the guy who can do it for you. I was not speaking in an official capacity as a moderator, just as a member of the forum. I do wish you luck on this.

  14. #14
    Registered User
    Join Date
    03-21-2015
    Location
    GrassyKnoll
    MS-Off Ver
    2010
    Posts
    82

    Re: Maintain & update an Error log .txt

    Anyway this is what I have come up with for now as a Step in my final resolution. Seems to work, but it feels wrong like theres gotta be a better way.
    Please Login or Register  to view this content.

+ 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. I need VBA code to update log worksheet and maintain a history of all orders.
    By adelkam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2013, 10:26 PM
  2. Print Macro / module error & Update / Clear Macro error
    By mal.b.graham in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-28-2012, 06:40 PM
  3. Maintain an update column for each cell update
    By cybersphere in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-15-2007, 10:28 PM
  4. Update Links Error...
    By HoseHead78 in forum Excel General
    Replies: 0
    Last Post: 03-01-2006, 02:05 PM
  5. error on update
    By Marlis in forum Excel General
    Replies: 5
    Last Post: 09-24-2005, 11:05 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