cancel
Showing results for 
Search instead for 
Did you mean: 

Read Hidden Columns from Excel

Hi Team,

How can I read values from hidden cells in a excel.
If now I am trying to read values from excel it's not reading values for hidden fields.

Please help me on this if possible.

------------------------------
Amlan Sahoo
RPA Consultant
Equinix
------------------------------
Regards,
Amlan Sahoo
13 REPLIES 13

NicholasZejdlik
Level 9
I ran into this same issue, so I added a page to the MS Excel VBO object to unhide a range. The code stage looks like this:

Dim Excel = GetInstance(Handle)
Excel.ActiveSheet.Range(Range).EntireColumn.Hidden = False

Handle is the numeric reference to the Excel application, and Range is a string consisting of an Excel range ("A1" or "B:G", for example).

Any hidden columns in the range will be unhidden, and you'll be able to read values from it as normal.

------------------------------
Nicholas Zejdlik
RPA Developer
Fujitsu America, Inc.
America/Chicago
------------------------------

Thanks Nicholas Ii will definitely help me.

------------------------------
Amlan Sahoo
RPA Consultant
Equinix
------------------------------
Regards,
Amlan Sahoo

Dim Excel = GetInstance(Handle)
Excel.ActiveSheet.Range(Range).EntireColumn.Hidden = False

the given code is working fine with unhiding columns in a excel

Also please let me know how to unhide a rows in excel to read a hidden rows values

------------------------------
Tamilarasi S
Associate software engineer
TechMahindra
Asia/Kolkata
------------------------------

Hi Tamilarasi,

For unhiding the rows in a given range, you can use the following code:

Dim Excel = GetInstance(Handle)
Excel.ActiveSheet.Range(Range).EntireRow.Hidden = False

Let us know if this helps.

------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

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

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

Hi Devneet,

Dim Excel = GetInstance(Handle)
Excel.ActiveSheet.Range(Range).EntireRow.Hidden = False

The given code is not working fine and I tried with range (A1:N50, 1:500)
Please let me know If we can achieve the same in different way .

------------------------------
Tamilarasi S
Associate software engineer
TechMahindra
Asia/Kolkata
------------------------------

The range you are providing seems bit weird to me, if you want to provide multiple ranges, you can provide the Text value in the Range parameter something as "A1:N50,A60:N100"

This code seems to be working as:

Dim Excel = GetInstance(Handle)
Excel.ActiveSheet.Range("A1:N50,A60:N100").EntireRow.Hidden = False


------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

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

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

What I meant is I tried the range with two ways A1:N50 and 1:500

------------------------------
Tamilarasi S
Associate software engineer
TechMahindra
Asia/Kolkata
------------------------------

Hi Tamilarasi,

In that case the first range should work where you are providing the "A1:N50" range as this is working on my machine. In case you are getting any error, please share the error details so that we can know more about it.

FYI, The same code is also being used in the 'Unhide Row(s)' action of the 'MS Excel - Extended' VBO which can be found in the following DX Exchange link: MS Excel - Extended

Please find the below snapshot for more details, Here in the Range argument provide A1:N50 as per your requirement:


Input Arguments:

14029.png
Code:

14030.png

------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

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

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

Hi Devneet,

I have used the Unhide Row(s)' action of the 'MS Excel - Extended' VBO and while I am running getting the below error. Please find the screenshot for your reference.
14035.png

14037.png
please let me if anything need to be added more......Thanks for your help.

------------------------------
Tamilarasi S
Associate software engineer
TechMahindra
Asia/Kolkata
------------------------------