VB Code to save as XML Spreadsheet

Desu Nota from Columbus

Well-known Member
Joined
Mar 17, 2011
Messages
556
I tried searching google and this website for a code and nothing worked.

I am opening notepad documents in excel and running a macro I recorded, and then I am manually clicking, save as-->xml spreadsheet, using the same file name.

How do you make this happen automatically? I need a code to add to the end of the macro I recorded.
 
Define sPath as a string and set it equal to the folder full path name (ending with a \). Example: sPath = "C:\Foo\Bar\August\"

and change

ActiveWorkbook.SaveAs Left(ActiveWorkbook.Name, InStrRev(ActiveWorkbook.Name, ".") - 1) & ".xml", FileFormat:=46

to

ActiveWorkbook.SaveAs sPath & Left(ActiveWorkbook.Name, InStrRev(ActiveWorkbook.Name, ".") - 1) & ".xml", FileFormat:=46
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Thanks a bunch, I am slowly starting to amass coding concepts. Thanks for the help again.

I got an email you responded to my last post, but it took me until now to find it was located on Page 2...:eeek:
 
Upvote 0

Forum statistics

Threads
1,225,157
Messages
6,183,247
Members
453,152
Latest member
ChrisMd

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