cancel
Showing results for 
Search instead for 
Did you mean: 

doubt regarding opening of excel workbook

krlalliram
Level 2

   I am a new learner of Blue Prism. I try to work in excel vbo. I create a process to read an excel workbook. While running the PROCESS an error message is shown in the ACTION to open the workbook. The error message is shown below:

Internal : Could not execute code stage because exception thrown by code stage: Culture is not supported.
Parameter name: culture
0 (0x0000) is an invalid culture identifier.

Please, help me to rectify the above error.

Thank you very much.

 

 

 

4 REPLIES 4

Neel1
MVP

hello @krlalliram - can you try below steps.

  1.     Open the Excel VBO .  
  2.    On the "Initialise" page, add a Code stage between Start and End.    
  3.    Within the Code Stage properties, use the following Code:
    Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo("xx", True)

Neel1_0-1718117749746.png    

Change the "xx" to the correct culture setting for your region - this should match the language settings on the machine you are running the runtime resource. 

A list of Culture Codes can be found from Microsoft here:

https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/supported-culture-codes 

Hi @krlalliram,

Agreed with @Neel1  suggestion that the issue is definitely due to incompatible language settings of the runtime machine. Just to add another enhancement to this code stage what he mentioned, we can use the below code to automatically identify the language setting as well instead of checking it manually as shown below:

 

try
{
    // Get the current system culture
    string currentCultureName = System.Globalization.CultureInfo.CurrentCulture.Name;

    // Set the current thread's culture to the detected system culture
    Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(currentCultureName, true);
}
catch (Exception ex)
{
    throw new Exception("Error setting thread culture: " + ex.Message);
}

 

If this does not work for you then, you will need to search for the language settings on your machine from Search menu -> Language Settings

devneetmohanty07_0-1718121991845.png

 

devneetmohanty07_1-1718122032213.png

From here, once you know the language settings for your machine, then you can go through the suggested method that @Neel1 has mentioned.

 

 



Hope it helps you out and if my solution resolves your query, then please mark it as the best answer

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

krlalliram
Level 2

Thank you for your guidance. Any how the following error message is given even after executing your suggestions.

Internal : Could not execute code stage because exception thrown by code stage: Culture is not supported.
Parameter name: culture
0 (0x0000) is an invalid culture identifier.

Hi @krlalliram,

 

Have you tried reinstalling Office Suite at your end as well. This then seems to be an internal problem with the DLL’s which has been configured during the installation itself or an Office update could have impacted the same. My suggestion would be to reinstall and try once and let us know on the same.



Hope it helps you out and if my solution resolves your query, then please mark it as the best answer

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------