How to write data i excel from application?

Class library usage, coding and language questions.
pripari
Posts: 4
Joined: Tue Apr 10, 2012 4:04 pm

How to write data i excel from application?

Post by pripari » Tue Apr 10, 2012 4:07 pm

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to write data i excel from application?

Post by Support Team » Wed Apr 11, 2012 1:38 pm

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

pripari
Posts: 4
Joined: Tue Apr 10, 2012 4:04 pm

Re: How to write data i excel from application?

Post by pripari » Wed Apr 11, 2012 1:49 pm

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.

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: How to write data i excel from application?

Post by Ciege » Wed Apr 11, 2012 4:13 pm

Have a look here for my implementation of using Microsoft.Office.Interop.Excel.
http://www.ranorex.com/forum/my-excel-f ... t3265.html
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

pripari
Posts: 4
Joined: Tue Apr 10, 2012 4:04 pm

Re: How to write data i excel from application?

Post by pripari » Mon Apr 16, 2012 1:53 pm

"Microsoft.Office.Interop.Excel" does not exists in Project->add Reference->COM
How to add "Microsoft.Office.Interop.Excel" reference in ranorex studio?

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: How to write data i excel from application?

Post by Ciege » Mon Apr 16, 2012 4:07 pm

It's under .NET not COM.

From VS: References -> Add Reference -> .NET -> Microsoft.Office.Interop.Excel
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to write data i excel from application?

Post by Support Team » Mon Apr 16, 2012 4:17 pm

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

pripari
Posts: 4
Joined: Tue Apr 10, 2012 4:04 pm

Re: How to write data i excel from application?

Post by pripari » Mon Apr 16, 2012 5:15 pm

We have excel installed on that machine, but still we could not see Micorsoft.Office.Interop.Excel under GAC folder.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to write data i excel from application?

Post by Support Team » Tue Apr 17, 2012 12:35 pm

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