Page 1 of 1

How to write data i excel from application?

Posted: Tue Apr 10, 2012 4:07 pm
by pripari
We are trying to send variable data in excel from Ranorex while execution. Please suggest the way to do this. We checked exceldataconnector but could'nt get proper code for the same. any help would be appreciated.

thanks

Re: How to write data i excel from application?

Posted: Wed Apr 11, 2012 1:38 pm
by Support Team
Hi,

Just to clarify this, you want to send variables from Ranorex Studio to your Excel sheet during the execution of your solution?
What do you want to accomplish whit this, or what is the sense of it?

Regards,
Markus
Ranorex Support Team

Re: How to write data i excel from application?

Posted: Wed Apr 11, 2012 1:49 pm
by pripari
We want to send variable names captured from application to external excel sheet which will be used for reprorting purpose. We are not able to get code for connecting to external excel sheet or creating new excel sheet within the code.

Re: How to write data i excel from application?

Posted: Wed Apr 11, 2012 4:13 pm
by Ciege
Have a look here for my implementation of using Microsoft.Office.Interop.Excel.
http://www.ranorex.com/forum/my-excel-f ... t3265.html

Re: How to write data i excel from application?

Posted: Mon Apr 16, 2012 1:53 pm
by pripari
"Microsoft.Office.Interop.Excel" does not exists in Project->add Reference->COM
How to add "Microsoft.Office.Interop.Excel" reference in ranorex studio?

Re: How to write data i excel from application?

Posted: Mon Apr 16, 2012 4:07 pm
by Ciege
It's under .NET not COM.

From VS: References -> Add Reference -> .NET -> Microsoft.Office.Interop.Excel

Re: How to write data i excel from application?

Posted: Mon Apr 16, 2012 4:17 pm
by Support Team
Hi,
pripari wrote:How to add "Microsoft.Office.Interop.Excel" reference in ranorex studio?
If you have installed Excel on the machine you should find the Microsoft.Office.Interop.Excel assembly in the GAC folder of the Add Reference Dialog.

Regards,
Peter
Ranorex Team

Re: How to write data i excel from application?

Posted: Mon Apr 16, 2012 5:15 pm
by pripari
We have excel installed on that machine, but still we could not see Micorsoft.Office.Interop.Excel under GAC folder.

Re: How to write data i excel from application?

Posted: Tue Apr 17, 2012 12:35 pm
by Support Team
Hi,
pripari wrote:We have excel installed on that machine, but still we could not see Micorsoft.Office.Interop.Excel under GAC folder.
If you want to interact with Excelobjects, you don't have to explicit add the Interop assembly, because Ranorex already has a reference to this assembly. Just use
Excel.Workbooks workBook = new Excel.WorkbookClass();
for example.

To check if you have access to this, check your reference folder and look if the office plugin is referenced to your project.

Regards,
Peter
Ranorex Team