Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by bigbuckaroo

  1. bigbuckaroo

    Change file name programmatically

    Due to this being more difficult for me than I anticipated, I have decided to go in a different direction with this whole process. I think to simplify it for me I will create the different subroutines and fire them off at the appropriate time rather then have 1 sub do all the work. I realize...
  2. bigbuckaroo

    Change file name programmatically

    Well, I tried as you suggested but still came up with the same error. When I run with the code you provided I get some different results in the line giving the error than when I did before. Ubound(lastnum) now = 4, lastnum(Ubound(lastnum)-1 = "2011 06 16 0003", str = "2011 06 16 0003" You did...
  3. bigbuckaroo

    Change file name programmatically

    Ok, so with your patience and gentle nudging I pondered your response above and think I am making small baby steps towards understandiing. I did some research and came up with the following modifications in my functions: Function nextnum(ByVal s As String) As String Function MySplit(ByVal s...
  4. bigbuckaroo

    Change file name programmatically

    I,m sorry. I am just not seeing what the problem is due to my lack of experience with this stuff. I may try again later tonight after I get home. Tom
  5. bigbuckaroo

    Change file name programmatically

    Well really all I see if I go back to your earlier post you said to change Split to MySplit so I changed the code to be: lastnum = MySplit(MySplit(s, "(")(0), "") Is this what you are refering to? When I run the code with it changed to this I now get a "byref argument type mismatch" I feel...
  6. bigbuckaroo

    Change file name programmatically

    Here is what I now have: Sub QC_LOG_FIND() Dim ofso, ofile, sPrevFile As String Set ofso = CreateObject("scripting.filesystemobject") For Each ofile In ofso.GetFolder("D:\QC_TEMP_CHECKS_LOG\QC TEMP CHECKS\").Files If sPrevFile < ofile.Name Then sPrevFile = ofile.Name Next MsgBox...
  7. bigbuckaroo

    Change file name programmatically

    "Can we just find out what application you are currently using to host your VBA? " Certainly!! The VBA is part of a SCADA software called RSVIEW32 which is made by Allen Bradley. Skip, I will try your suggestion regarding the "MySplit" you suggested and report back. Thanks Tom
  8. bigbuckaroo

    Change file name programmatically

    Excel was recently added to the computer that runs this application. I have it added to the references so I would assume it could be used in my VBA code right? This would be preferable as I would also at a later time like to use Excel to modify the created file. That part is for a later time...
  9. bigbuckaroo

    Change file name programmatically

    I now have the following code: Sub QC_LOG_FIND() Dim ofso, ofile, sPrevFile As String Set ofso = CreateObject("scripting.filesystemobject") For Each ofile In ofso.GetFolder("D:\QC_TEMP_CHECKS_LOG\QC TEMP CHECKS\").Files If sPrevFile < ofile.Name Then sPrevFile = ofile.Name Next MsgBox...
  10. bigbuckaroo

    Change file name programmatically

    Here is a copy of the code: Function nextnum(s As String) As String Dim lastnum lastnum = Split(Split(s, "(")(0), " ") nextnum = Format(CInt(lastnum(UBound(lastnum) - 1)) + 1, "0000") Dim ofso, ofile, sPrevFile As String Set ofso = CreateObject("scripting.filesystemobject") For Each ofile In...
  11. bigbuckaroo

    Change file name programmatically

    I hope I am doing this correctly. When I highlight s, click on DEBUG,then click on ADD WATCH the following comes up at the bottom of the screen: Watch : : s : <Can't compile module> : Empty : ThisProject.nextnum When I go to DEBUG then COMPILE I get an UNEXPECTED ERROR 32811 but when I go...
  12. bigbuckaroo

    Change file name programmatically

    Ok so after a couple of days I am getting back to this again. I spent some time and this is the code I have so far: Function nextnum(s As String) As String Dim lastnum lastnum = Split(Split(s, "(")(0), "") nextnum = Format(CInt(lastnum(UBound(lastnum) - 1)) + 1, "0000") Dim ofso, ofile...
  13. bigbuckaroo

    Change file name programmatically

    Ok now with the added steps it becomes a little more clear. I will give it a try and get back with the results. I sincerely am greatful for your help. Tom
  14. bigbuckaroo

    Change file name programmatically

    Why not simply use the Dir function to retrieve all the files of the day ?" Answer: The goal is to record the temperatures at specific times. I agree it would be much simpler to send one file with all the checks for the day. This is not what is desired by the QA department. Currently a lab...
  15. bigbuckaroo

    Change file name programmatically

    Wow! That might take me some time to digest since I'm sure you can tell I am quite the novice when it comes to VBA. I will do some experimentation and see what I can come up with. Thank you Tom

Part and Inventory Search

Back
Top