Visual basic scripts to modify exported tasks?
Hi there people.
Are there any VB scripts, or any other for that matter, wherby you can export a task, search and replace, save, and then import it back inot a project?
Let me tell you what I have done and where it fails. I have 215 analog tasks. I have created the base task and exported it. I then opened the .prt file as a text document and copied this into a sheet in Excel.
1. Created another sheet with a table of all the tags/variables for each analog task.
2. Wrote a script to create 215 sheets in order.
3. Wrote a script to populate all 215 sheets with the exported .prt text
4. Wrote another script to, for each sheet, take a different data area in the table and replace my dummy tags with those. I ended up with 215 unique sheets.
5. Wrote a script to export this to .txt documents.
Cool up to this point. Problem is, if I copy this text, which is similar to the text in the .prt file, to a blank .prt file, I keep on getting errors of "file corrupt" to "not Unicode".
I can do this process manually and it works, but can not get the script to give me useable data for my Freelance project. Must be somehing in Excel, VB or text files?
Are there any tools available to automate this process. I can not think that you would want to do this process totally manual. Some lazy sod like me must have had the idea to make things easier. Who is he? :)
Pleas help or guide me in the right direction?
Voted best answer
"not Unicode" should lead you to the real issue. Could it be your generated files are just ascii? Valid .prt files are typed in unicode. Look https://en.wikipedia.org/wiki/Unicode if "unicode" does not say something to you.
PS: "Mass generating" .prt files DOES work, i already done this before, but thrown away the script. (Was quick & dirty delphi program if i remember right)