PTV Visum - Frequently Asked Questions (FAQs)
(#VIS18714)
How can I edit matrix values over COM using Excel/VBA?
Following variants are possible:
- By referencing the matrix value by zone numbers:
Visum.Net.ODPairs.ItemByKey(100, 200).AttValue('MatValue(1)') = 1000
- By referencing the matrix value by row and column.
Visum.Net.Matrices.ItemByKey(1).SetValue 1, 2, 5000
- More efficient is using a safearray as input:
Visum.Net.Matrices.ItemByKey(1).SetValues myArray
Example codes are available in:
http://vision-traffic.ptvgroup.com/faq-files/PTV_COM_EditMatrixValues.zip