Macro VBA to update information in xml file

Vasilchyk Vladik

New Member
Joined
Jan 24, 2023
Messages
7
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Good day

In general, such a question.
There is an excel file with fields

IDNamePrice
101Pos#110
102Pos#220

and there is an xml file of this format

XML:
<offer available="true" id="101">
<price>10</price>
<currencyId>UAH</currencyId>
<categoryId>91456</categoryId>
<name>Товар №1</name>
<description><![CDATA[
<p>AAAAA.</p>]]></description>
<vendorCode>90/5</vendorCode>
<stock_quantity>1</stock_quantity>
</offer>

The task is that when you press a button in Excel from the desired line, focusing on the product id, information about the updated price is taken and the price in the xml file is updated with a reference to the product id.

That is, I change the price in Excel for 1 product to 12, and the second to 9, and press the macro start button. The price in the required xml file changes according to the principle for the product with id 101, the value in the <price></price> field changes from 10 to 12, and from 20 to 9 from id 102. Nothing else in this file changes.

Thanks for answers
And sorry for my bad english
 
Domenic, i don't even know how to thank you. Everything works great.
Thank you very much for spending so much time on my problem.
The problem is completely solved. Everything works as I need.
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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