Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro is not connecting to R

Hi,

I wrote am macro as below:

1. Copy the chart properties and paste it to excel.

2. Connect to R and convert the excel data into JPG image.

3.Reload the script

Macro is as below:

Sub Test

XlsPath = "c:\lab\patient.xls"
'Create excel File
MsgBox("1")
Set objExcel = CreateObject("Excel.Application")

Set objWorkbook = objExcel.Workbooks.Add()

Set objWorksheet = objWorkbook.Worksheets(1)

'ActiveDocument.GetSheetObject( "CH148" ).CopyTableToClipboard true

set table = ActiveDocument.GetSheetObject( "CH148" )

'DIm array(7,2)
For RowIter = 0 to table.GetRowCount-1
For ColIter = 0 to table.GetColumnCount-1
set cell = table.GetCell(RowIter,ColIter)
'array(RowIter,ColIter)=cell.Text
objWorksheet.Cells(RowIter+1,ColIter+1).Value=cell.Text
'Msgbox(cell.Text)
Next
Next

objWorkbook.Saveas XlsPath
MsgBox("2")
objWorkbook.close
objExcel.quit

Set R = CreateObject("StatConnectorSrv.StatConnector")
R.Init "R"
MsgBox("Hi")
R.EvaluateNoReturn "source('C:/lab/Commands.R')"
MsgBox("Hi2")
ActiveDocument.Reload()

End Sub .

In my desktop its working fine.

But when I place the same qvw in accesspoint, macro is not connectign to R.

I opened the QVW file with 'IE plug in' only.

Please help ASAP.


0 Replies