Auto Save As Excel to XML

rockstar

New Member
Joined
Mar 25, 2011
Messages
4
Hi All...Can somebody share VB Script to automate save as function in Excel. Basically, I have a dynamic Excel File which has to be saved as corresponding XML file. I have the corresponding XML file created, so my dynamic Excel has to be saved as XML over existing XML file. Another thing, my dynamic Excel file is an XML mapped spreadsheet, in case that matters in guiding me to the right script. Thanks.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Sub Macro1()
'
' Macro1 Macro
ActiveWorkbook.SaveAs Filename:= _
"C:\Book1.xml", FileFormat:= _
xlXMLSpreadsheet, ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

You will have to change the file name and location, only works with the active workbook.
 
Upvote 0
Hi Ropes...Thanks for the reply. What exaclty you mean by active workbook? Do I have to open the excel file to run the macro? Sorry if I have not mentioned in my post, I'm basically looking for a way to save my dynamic spreadsheet as XML without manual intervention. My dynamic excel file is referred to another spreadsheet which is a Crystal reports output in Excel Format. So whenever new Crystal reports output is saved as Excel, my dynamic excel sheets is updated and this is where it has to be saved on existing XML file. Then that refreshed data would reflect in my dashboard which is my ultimate goal. Appreciate if you could confirm about above macro, if it would serve my purpose, if not please share script that would serve my purpose. Thank you.
 
Upvote 0
I am in class all week but will look at this when I get out if you have not gotten and answer by then..
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top