Prev: Need advise on getaudiodata [Is for wav file frequency /pitch extract purpose]
Next: Help in the Fitness Function on GA toolbox
From: Roberto on 2 Aug 2010 09:43 "Andy " <myfakeemailaddress(a)gmail.com> wrote in message <i36hbb$g0m$1(a)fred.mathworks.com>... > "Roberto " <ivogrunn(a)hotmail.com> wrote in message <i36fo6$2mf$1(a)fred.mathworks.com>... > > "Andy " <myfakeemailaddress(a)gmail.com> wrote in message <i36ein$g30$1(a)fred.mathworks.com>... > > > Have you tried changing the problematic line to: > > > > > > ActiveChart.SeriesCollection.Item(1).XValues = "=Page2!R3C2:R3C46" > > > > Yup, I've also tried that and it still works when I run it from excel. But when I run it via the m-code, it doesn't work... > > Have you tried replacing the string "=Page2!R3C2:R3C46" with the Range object that represents that range? What do you mean? The range is "B3:AT3"
From: Andy on 2 Aug 2010 09:55 "Roberto " <ivogrunn(a)hotmail.com> wrote in message <i36i1a$t00$1(a)fred.mathworks.com>... > "Andy " <myfakeemailaddress(a)gmail.com> wrote in message <i36hbb$g0m$1(a)fred.mathworks.com>... > > "Roberto " <ivogrunn(a)hotmail.com> wrote in message <i36fo6$2mf$1(a)fred.mathworks.com>... > > > "Andy " <myfakeemailaddress(a)gmail.com> wrote in message <i36ein$g30$1(a)fred.mathworks.com>... > > > > Have you tried changing the problematic line to: > > > > > > > > ActiveChart.SeriesCollection.Item(1).XValues = "=Page2!R3C2:R3C46" > > > > > > Yup, I've also tried that and it still works when I run it from excel. But when I run it via the m-code, it doesn't work... > > > > Have you tried replacing the string "=Page2!R3C2:R3C46" with the Range object that represents that range? > > What do you mean? > The range is "B3:AT3" So replace the string with something like Worksheet.Range('B3:AT3') or Worksheet.Range('B3:AT3').Value (were Worksheet should be the handle to the sheet named Page2).
From: Roberto on 2 Aug 2010 10:30 "Andy " <myfakeemailaddress(a)gmail.com> wrote in message <i36iog$g0j$1(a)fred.mathworks.com>... > "Roberto " <ivogrunn(a)hotmail.com> wrote in message <i36i1a$t00$1(a)fred.mathworks.com>... > > "Andy " <myfakeemailaddress(a)gmail.com> wrote in message <i36hbb$g0m$1(a)fred.mathworks.com>... > > > "Roberto " <ivogrunn(a)hotmail.com> wrote in message <i36fo6$2mf$1(a)fred.mathworks.com>... > > > > "Andy " <myfakeemailaddress(a)gmail.com> wrote in message <i36ein$g30$1(a)fred.mathworks.com>... > > > > > Have you tried changing the problematic line to: > > > > > > > > > > ActiveChart.SeriesCollection.Item(1).XValues = "=Page2!R3C2:R3C46" > > > > > > > > Yup, I've also tried that and it still works when I run it from excel. But when I run it via the m-code, it doesn't work... > > > > > > Have you tried replacing the string "=Page2!R3C2:R3C46" with the Range object that represents that range? > > > > What do you mean? > > The range is "B3:AT3" > > So replace the string with something like Worksheet.Range('B3:AT3') or Worksheet.Range('B3:AT3').Value (were Worksheet should be the handle to the sheet named Page2). Ok, I've tried to rewrite it, but I don't know how I could change the "=Page2!R3C2:R3C46" part in something like ActiveChart.SeriesCollection(1).XValues Sheets("Page2").Range("B3:AT3") Do you know that?
From: Andy on 2 Aug 2010 10:42 The following example works for me (run as a MATLAB script): e = actxserver('excel.application'); eWs = e.Workbooks; eW = eWs.Add; eS = eW.ActiveSheet; e.Visible = 1; x=(0:2:100)'; y=sin(x); eS.Range('A1:B50').Value = [x y]; eCO = eS.ChartObjects.Add(100, 30, 400, 250); eC = eCO.Chart; eC.SeriesCollection.NewSeries; eC.SeriesCollection(1).Value = eS.Range('B1:B50'); eC.SeriesCollection(1).XValue = eS.Range('A1:A50');
From: Roberto on 2 Aug 2010 12:01
"Andy " <myfakeemailaddress(a)gmail.com> wrote in message <i36lgf$hie$1(a)fred.mathworks.com>... > The following example works for me (run as a MATLAB script): > > e = actxserver('excel.application'); > eWs = e.Workbooks; > eW = eWs.Add; > eS = eW.ActiveSheet; > e.Visible = 1; > x=(0:2:100)'; > y=sin(x); > eS.Range('A1:B50').Value = [x y]; > eCO = eS.ChartObjects.Add(100, 30, 400, 250); > eC = eCO.Chart; > eC.SeriesCollection.NewSeries; > eC.SeriesCollection(1).Value = eS.Range('B1:B50'); > eC.SeriesCollection(1).XValue = eS.Range('A1:A50'); Yes! We/you/I've made it!! It works right now :) Tnx! |