Hey Everyone,
I am at an absolute loss as to why my Replace function is not working... I was expecting this part of my project to be easy, and the function does not give an error message or anything like that - it simply just isn't doing what it is supposed to be doing...
I have attached 2 sample files - my Excel sheet and a Text file. Now, the Excel sheet has a lot more in it that just the problem area. I gave you everything that comes before that point as well so you could see it in context, and see what is happening leading up to it.
To get to the problem area, do the following:
- Run the User Form
- Select Template One (or, really, any of the Templates)
- Fill in any random value for the ID, name, and Variable feilds (I left the sample very generic)
- Click the Command button to edit the Template
- use the Text Box on the top left to make some kind of modification - any change at all is fine
- Click the "Make Your Changes Permanent" button
Now, going back a step. When you opened the Template originally (in step 2), VBA pulled that template from the .txt file. When you edit the template then click the button to make the change permanent (Steps 5 and 6), VBA is supposed to overwrite that part of the text file with the changes you made in the Text Box. I was accomplishing this by storing the original value of the template in its own Variable, then using that in a Replace function to find the original text and replace it with the new text. This is all happening, for the most part, in the Private Sub cmd_Perm_Click() section.
Now, the issue is - all of this works without giving any kind of error, but it does not actually update the .txt file with the new text from txt_Preview.Value. I am at an absolute loss as to why it is not working... Any help would be greatly appreciated!!!Please Login or Register to view this content.
Thanx everyone!!!
Bookmarks