Hey, can anyone give me a hand with some code that automatically moves files with a certain word within the filename to a specific folder?
So all files where the filename contains "LH" gets moved to the folder called "LH"...all files where the filename contains "BH" gets moved to the folder...
I'm using this code within an excel macro to cycle through all workbooks in a directory and execute code within each one -
Dim wb As Workbook
Dim TheFile As String
Dim MyPath As String
MyPath = "C:\Temp"
ChDir MyPath
TheFile = Dir("*.csv")
Do While TheFile <> ""
Set wb =...
Does anyone have any experience in using VB for a program called AnyDoc?
You can implement VB to modify the templates that are used for data extraction, but there is no information on the net to help me with this...
I'm not sure how widely the software is used so I'm not sure how many of you...
hey thanks...so calling the function from a loop will cause it to keep repeating the loop when an error occurs?
im not completely sure how to create the function or call it from a loop, any tips?
I am renaming files from .txt to .csv within a directory. the code i am using to do this is -
Dim number As Integer
number = 5
Do While number = 5
Dim dir As DirectoryInfo = New DirectoryInfo("\\IFADATAFLOW1\SharedDocs\Test production bucket...
Here's something I've been trying to do, hope someone can help with it...
I want to move files from one location on my computer to another using listboxes. What I want to do is set up two list boxes side by side, I want listbox1 to display the contents of a particular folder on my computer, and...
The software I'm using at the moment outputs .txt files, which I then have to rename manually to a .csv.
Sometimes that involves renaming 30 or so files, which takes a while.
How would I go about writing something in Visual Basic Express that would rename all the the files to have a .csv...
I've fixed the problem of the text overwriting, and the issue of saving data into an already open txt file...so I think it's now more or less functional in the way I wanted, thanks alot for your help.
Here's what I did just in case you're interested -
Imports System.IO
Public Class Form1...
I've realised something while playing around with this, it's going to be a problem when somebody has the text file open reading the error logs, and someone else is trying to save a new error to it using the form at the same time.
Is there a way around that? If not would it be possible to create...
Hey thanks for that, seems to be what I was looking for. As you mentioned in the comments though, each time data is submitted to the text file, it overwrites it, losing the previous entry.
How would I go about preventing that?
I've got a question that I hope someone can answer for me...At my place of work we have one person that creates programs for the other employees to use. Because of the nature of the work there are generally errors, and the process of reporting them is rather fuzzy.
What i want to do is create a...
Thanks, just so i understand, the Private Function code should be placed outside of the button_click events, and then the other two bits are placed within their respective button_click events?
I have two questions though - I have lots of different buttons opening up different customer...
that works completely now, tested it thoroughly today, thanks alot.
I have another question for you if you dont mind...
In that image there are two buttons, the one on the left opens a folder using that code you gave me...the button on the right displays the file contents of that folder in...
yep that works correctly now thanks alot for that!
One last question on this subject though - because of the strict date format applied in that code, the program will crash if there is a folder in the directory that doesnt apply to the rule 'MMM YYYY'. For example in some folders there is an...
Thanks, I've been testing that out and the code seems to be sorting the month subfolders alphabetically rather than by date, so in practice, it navigates through the September folder every time...the subfolders for the specific days always opens correctly on the most recent creation date though...
Paul (or anyone), I've put this program into testing this morning (see code in my post above). I've got a slight problem with it though.
The code is set up to look for the main customer folder and then the sub folder named with the current month.
The problem with that is, when a new month...
Kind of, I did need to add an 'IO' in there, DirectoryInfo wasn't recognised so i changed it to IO.DirectoryInfo and that works perfectly! Thanks alot for your help, got there in the end.
Just in case anyone else ever needs to do this, ill post the working code I'm using -
Public Class Form1...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.