M
Mangesh Yadav
Hi,
Need some help regarding the following. I am making a VB DLL to convert some
of my excel macro code. The following is working fine where I set "myRng" as
an excel range, and then create a VB variable "myR" with a for statement and
then send it to matlab using the PutFullMatrix. Something like this
Sub MySub(myApp As Object)
Set myRng = myApp.Worksheets("Sheet1").Range("A1:A10")
myRows = myApp.Worksheets("Sheet1").Range("A1:A10").rows.Count
For i = 0 To myRows - 1
myR(i, 0) = myRng(i + 1)
Next i
Set Matlab = CreateObject("matlab.application")
Call Matlab.PutFullMatrix ("myR", "base", myR, myRImag)
Now my question is: Why do I have to use a for statement. That would make me
use as many for loops as there are input ranges. Can't I do something like:
Sub MySub(myApp As Object)
Set myRng = myApp.Worksheets("Sheet1").Range("A1:A10")
Set Matlab = CreateObject("matlab.application")
Call Matlab.PutFullMatrix ("myR", "base", myRng, myRImag)
where I send the variable "myRng" directly to matlab instead of explicitly
using a for loop to create a VB varaible.
Need some help regarding the following. I am making a VB DLL to convert some
of my excel macro code. The following is working fine where I set "myRng" as
an excel range, and then create a VB variable "myR" with a for statement and
then send it to matlab using the PutFullMatrix. Something like this
Sub MySub(myApp As Object)
Set myRng = myApp.Worksheets("Sheet1").Range("A1:A10")
myRows = myApp.Worksheets("Sheet1").Range("A1:A10").rows.Count
For i = 0 To myRows - 1
myR(i, 0) = myRng(i + 1)
Next i
Set Matlab = CreateObject("matlab.application")
Call Matlab.PutFullMatrix ("myR", "base", myR, myRImag)
Now my question is: Why do I have to use a for statement. That would make me
use as many for loops as there are input ranges. Can't I do something like:
Sub MySub(myApp As Object)
Set myRng = myApp.Worksheets("Sheet1").Range("A1:A10")
Set Matlab = CreateObject("matlab.application")
Call Matlab.PutFullMatrix ("myR", "base", myRng, myRImag)
where I send the variable "myRng" directly to matlab instead of explicitly
using a for loop to create a VB varaible.