Комментарии:
Hi Mukesh can we read excel file using invok code and get output in datatable.
ОтветитьHow to do the same process for Google sheets? Please explain.
ОтветитьHi Mukesh bhayya. I want to write a code in Vb to replace the read range activity. Can you please throw some hint regarding that. TIA
ОтветитьThanks a lot! :D
ОтветитьHey, is it easier to use this method or using the Balareva package?
Regards
When I run this process and open the excel file afterwards, I get a notification saying that the file is locked for editing by myself and that I can only open it in 'read-only' format. When I look at the file, none of the columns actually got un/hidden. I then closed Excel and tried to delete the file, but it said that it is being used by Excel still, which was odd. So I went to task manager and noticed that, every time I ran the UiPath process, it created an Excel background task. I ended all of those and then tried to open the excel file again. When I did, the notification wasn't there anymore, but the columns were still unaffected and I got a side bar titled 'Document Recovery,' asking me which versions of the file I wanted to save (it only showed the originals).
Here is the code in my invoke code activity:
Dim xlApp As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws As Microsoft.Office.Interop.Excel.Worksheet
xlApp = New Microsoft.Office.Interop.Excel.Application
wb = xlApp.Workbooks.Open(in_filename)
ws = CType(wb.Sheets(in_sheetname),Microsoft.Office.Interop.Excel.Worksheet)
ws.Activate
ws.Range("A:G").Columns.EntireColumn.Hidden = False
xlApp.DisplayAlerts = False
xlApp.Visible = False
Hope this all makes sense! I did everything the video said, including downloading the Microsoft.Office.Interop.Excel package and importing the namespace with the same name. I also did the behind-the-scenes editing of the .xaml file. Trying to save the file in a different format also didn't change anything.
I am confused why my columns aren't being hidden/unhidden and also why I'm getting these Excel background tasks every time the program runs. Please help!
Title is misleading. There is no code to hide / unhide sheets. It should be hide / unhide columns
Ответить