PDA

View Full Version : Convert selected file to XML and save.



dhivya.enjoy
10-03-2013, 02:42 PM
1252

Hi Team,

I am given a task to develop a macro similar to attached file. Basically what I need to do is, when a raw data file in excel format is uploaded to excel and then it should get converted to a xml file . This need to be developed using a macro.

I want to set-up a button similar in the attached sheet which on pressing asks for the input file and then output file name, on pressing submit it generates the xml file.

I know the basic concept of creating a macro but I dint understand how the activities behind the button is performed. I am not aware of VBA coding, so if I can achieve everything with the normal Excel options. Please explain so that I can try the same.

Thanks in advance

Regards
Dhivya

RosyRai
10-03-2013, 04:34 PM
Hi Divya,

As per your requirement above we can able to help you.

If you are interested we can provide you the training on the VBA\Macro so that you can able to do by your own.

Kindly let me know if you are interested to learn?

Thanks,
Rosy

dhivya.enjoy
10-04-2013, 06:37 PM
Hi Rosy,

Thanks , but when the trainign will be scheduled, its quite urgent deliverbale thats why i sought some ideas from people in the forum

dhivya.enjoy
10-04-2013, 06:47 PM
Hi Team,

I developed a macro wherein you need to enter the required values for the columns and then on pressing the button the macro will run and generate a xml file.

The issue I face is when I press the button and xml file is generated and saved in the desktop, again on changing the data and running the macro error appears as below screen shot. This is because that when the output xml file is available in the desktop and trying to regenerate the output file, it generates with the same name in that case the error appears. But this should not be the case it should update or replace the xml file generated.

Also one more issues is whenever the xml file is getting stored it always look for my desktop location, my desktop location is hard coded in this. Not sure how to make this a generic one so that it will work in others pc too.


Please advise.



1254

Regards
Dhivya

bakerman
10-05-2013, 03:01 AM
Please post the macro you created so we can see for ourselves how we can help you with your issues.

dhivya.enjoy
10-07-2013, 11:29 AM
Hi Bakerman,

Please find the attached macro. You need to create a folder names xml_Extract in c: to see the output xml file.

Output file will be of name output.xml.

Please advise on my issues

Thanks in advance
Regards
Dhivya

bakerman
10-09-2013, 04:15 AM
Generic Desktop-path

With CreateObject("WScript.Shell")
SpecialFolderPath = .SpecialFolders("Desktop")
End With

If you make only 1 file each day, you could add a date to the filename so it's unique name every day.

dhivya.enjoy
10-09-2013, 01:32 PM
Thank you so much..I will try this option.