Monday, January 4, 2021

 

Ideas to deal with Excel Hanging

 

Problem

if you use excel scope activity, excel is supposed to close after the scope is closed. It takes a while for excel to close. In windows 10 and 0365 it takes a very long time to close. When reopening excel, excel can hang.

 

Solutions

 

Kill

Before each scope make sure to kill excel processes

Issue – the kill doesn’t always work

 

Keep scope alive

Open excel scope only once and keep the session in a shared variable throughout the bot








 

Use system file read range

Instead of using scope use the following:


 

 

Issues

1)

If the spreadsheet contains email addresses you will get invalid url issue – go into excel and remove the links

tgermazvi@herbert.com

 



2)

If there are dates, this will pick up the excel numeric date

You need to convert back to date:

DateTime conv = DateTime.FromOADate(d);

delete range in file workbook activities

 

There is no delete range

Use write cell (write a value of “”) instead

Wednesday, December 23, 2020

trim in excel

 removes multiple spaces on between words

Saturday, November 21, 2020

get current connection string- cute

 select

    'data source=' + @@servername +

    ';initial catalog=' + db_name() +

    case type_desc

        when 'WINDOWS_LOGIN' 

            then ';trusted_connection=true'

        else

            ';user id=' + suser_name()

    end

from sys.server_principals

where name = suser_name()

Tuesday, October 27, 2020

Sunday, October 18, 2020

number of cores

 wmic cpu get numberofcores/format:list