cancel
Showing results for 
Search instead for 
Did you mean: 

How to Write Collection to Excel

VinayRaut
Level 3
Hello,   I am using the provide VBO object of MS Excel, Create Excel. However while writing the collection to the excel it is giving some errors. Can you please help with some example.   Thanks.
10 REPLIES 10

Denis__Dennehy
Level 15
Hello. Would you care to share the errors you are getting?

VinayRaut
Level 3
Workbook Not Found : Workbook named: C:\Folder\Test.xlsx not found in instance: 0 The excel exist still this error is recieved.

TomaszAdamski
Level 5
AFAIK the Workbook name would be Test.xlsx in this case. 

VinayRaut
Level 3
But in that case where will the excel be saved

VinayRaut
Level 3
When the details from attached screen are given - following error is recieved . Internal : Could not execute code stage because exception thrown by code stage: The given key was not present in the dictionary.

Denis__Dennehy
Level 15
I strongly recommend visiting the Process Examples (available in the templates area of the portal) and also re-visiting the Foundation Training course for examples of how to interact with Excel.  Based on your error you simply need to experiment a bit with how you are creating the instance of excel and creating or opening your Excel workbook.

VinayRaut
Level 3
To work with excel you should use Excel VBO and don't have to launch by defining application moduller. Below actions from MS Excel VBO should work. create instance Open workbook Show

Sri_Krishna_Cha
Level 5
Hi -   When you are creating an instance in the first place, it will not get saved.. It just hangs in there at the run time and hence supplying workbook name as test.xlsx will be sufficient. Just use the internal VBO and then create it. As Vinay suggested first.. first create an excel instance(handle number will be output) and then create the workbook(handle number from the first step will be input and workbookname will be output). Show action is not really mandatory. However just to understand the data is getting copied into the excel or any other operations with excel, show action is recommended. Use Create worksheet action (Workbook name will be input and worksheet name will be output). Then write collection to excel action will be used to write the collection data into the excel. Fields in collection should match with the columns in the excel. After writing data into the excel, please save the Workbook using save workbook as action, in this action you need to provide the complete path of the excel location.

VinayRaut
Level 3
Thanks Chaitanya, yes i implemented in similar fashion successfully. Just one final important point is to Close Instance after work is done. This object is available in the VBO. Provide the same handle instance data item from step one as a input and Save as True.