<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to define variables in Mathcad using API via Excel 2010 in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415903#M162866</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for this; much appreciated. Unfortunately I'm not much of a programmer and would appreciate it if anyone has a VBA version of the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Aug 2013 14:31:26 GMT</pubDate>
    <dc:creator>ptc-5200262</dc:creator>
    <dc:date>2013-08-13T14:31:26Z</dc:date>
    <item>
      <title>How to define variables in Mathcad using API via Excel 2010</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415901#M162864</link>
      <description>Hi All,I was hoping someone might be able to help. I'm using Mathcad 14 to perform calculation cases. I could easily have 50 sets of case in either Excel or Matlab and need to generate 50 corresponding worked through cases. Ideally I would like to generate each case file as a</description>
      <pubDate>Thu, 03 May 2018 17:03:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415901#M162864</guid>
      <dc:creator>ptc-5200262</dc:creator>
      <dc:date>2018-05-03T17:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to define variables in Mathcad using API via Excel 2010</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415902#M162865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you use SetValue (based on your description, I assume this is what youe are using to set the value in the worksheet) the variable is bound before any binding that is in the worksheet. So if you set a value of 3 for b, and then have a definition b:=3 in the worksheet, the variable binding from the API is prior to the worksheet definition, and is therefore overwritten by it. You cannot change a worksheet assignment using SetValue. If you really want to change a variable definition in the worksheet then you need to edit the XML of the region. The attached worksheet shows how to do this using a vbscript (which should be easy enough to port to VBA).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 17:36:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415902#M162865</guid>
      <dc:creator>RichardJ</dc:creator>
      <dc:date>2013-08-12T17:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to define variables in Mathcad using API via Excel 2010</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415903#M162866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for this; much appreciated. Unfortunately I'm not much of a programmer and would appreciate it if anyone has a VBA version of the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 14:31:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415903#M162866</guid>
      <dc:creator>ptc-5200262</dc:creator>
      <dc:date>2013-08-13T14:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to define variables in Mathcad using API via Excel 2010</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415904#M162867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you set up your file? I'm trying to do something similar at the moment only I have absolutely no idea where to start. I can't even get mathcad to open in the VBA script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My ultimate goal is rather simple I think, I just want a macro to open mathcad from excel and copy values from excel into the mathcad document and then save the mathcad file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 17:26:36 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415904#M162867</guid>
      <dc:creator>tpenshorn</dc:creator>
      <dc:date>2014-01-06T17:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to define variables in Mathcad using API via Excel 2010</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415905#M162868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; opening Mathcad from Excel isn't too difficult.&lt;/P&gt;&lt;P&gt;The Help files aren't too descriptive but at least it does seem to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copying the values into the sheet however is a little more difficult.&lt;/P&gt;&lt;P&gt;Using SetValue will force the value change but in a temporary way, it isn't saved in the XML code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the regions function to access the XML code &amp;amp; it can be changed (as in the attached).&lt;/P&gt;&lt;P&gt;The downside is that mathcad doesn't know that there has been a change so you will need to explicitly save the document.&lt;/P&gt;&lt;P&gt;My quick code is messy &amp;amp; the file name needs to be created properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other issue stems from how you code the XML to write.&lt;/P&gt;&lt;P&gt;I have taken code to assign a value to a variable &amp;amp; copied it into a string. to do more than this will be very complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each tag in the property field must be unique but there should be no limit to the number permitted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 11:20:48 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-define-variables-in-Mathcad-using-API-via-Excel-2010/m-p/415905#M162868</guid>
      <dc:creator>AndyWesterman</dc:creator>
      <dc:date>2014-01-08T11:20:48Z</dc:date>
    </item>
  </channel>
</rss>

