Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

First free row is not first free row

Hi, I have a strange issue. I am extracting a value from a website and save it a variable. This value is then written into an Excel sheet using the "Write to Excel Worksheet" activity.


The value is set to be written into column 1, FirstFreeRow.  This should be cell A1. So far everything should be fine, however, when the value is written in, it is written in A5. There are no values in the range A1:A4 so this should not really happen.


Any ideas why this is happening?




Best Answer

Thank you for sharing the additional information.


Regarding the issue you are confronting, you could try the below:

  • Launch Excel
  • start looping through extracted data
  • If first: 
    1. Write directly the first number in A1 and the table in B1
  • else: 
    1. Get first free row and column
    2. write number in A[first free row]
    3. write table in B[first free row]


Please note that the "Get first free row and column" Action in the Excel group of actions, gives the lower right free row and column.


I hope the above makes sense.



ADMIN

Hello Peter,


please note that you can directly store the data into an excel file as shown in the image below:



As far as I can understand, you store the extracted data into a variable and then you write them in an existing excel file.  This is an MS Excel file issue, however, when you save a workbook, Excel may store empty cells contain formatting that causes the last cell in a row or column to fall outside of the range of cells that contains data. 


I hope the above is helpful. If not, please give me some more information regarding the steps you make in the process. 

Thanks for the reply.  What I try to do is this. 


1. Extract a number from a website

2. Extract a corresponding table from the same website

( This will be several numbers and several tables so all values are saved in a variable so it can be iterated thru using "For each" loop.

3. I want to write the first number in A1. ( FirstFreeRow in column 1)

4. I want to write the table in FirstFreeRowOnTable in column 2.


As the table has a different number of rows, at the next iteration the number in column 1 should appear in the first free row in column, which is the first under the last row in the table. 


However, now the first number may be in column 1 row 5, and the first row in the table may be in column 2 row 1.  


Then I have a mess....

ADMIN
Answer

Thank you for sharing the additional information.


Regarding the issue you are confronting, you could try the below:

  • Launch Excel
  • start looping through extracted data
  • If first: 
    1. Write directly the first number in A1 and the table in B1
  • else: 
    1. Get first free row and column
    2. write number in A[first free row]
    3. write table in B[first free row]


Please note that the "Get first free row and column" Action in the Excel group of actions, gives the lower right free row and column.


I hope the above makes sense.


It does. Thanks!

ADMIN

You are welcome, Peter!


Keep on automating :) 

Login or Signup to post a comment