Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copy Excel Worksheet to DataTable
#1
Not Solved
Hey there,

I'm trying to copy some Sheets from an Excel file to DataTables. Since the Excel file is opened during the test run I can neither use
Code:
DataTable.import(path)
nor
Code:
DataTable.ImportSheet path,source,dest

I'm currently creating an instance of the Excel file via
Code:
Set xlsworkbook = GetObject("path")
and then setting objects for the needed Excel Sheets via
Code:
Set xlsworksheet1 = xlsworkbook.WorkSheets("name1")
Set xlsworksheet2 = xlsworkbook.WorkSheets("name2")
...

By this I get an instance of the wanted Excel Worksheets. I can get the name and the content of cells etc.

What I'm now trying to do is to somehow copy the complete content of the xlsworksheet into my datatable. I have already thought about using loops but hope there's a better and more performant solution.
Anyone able to help me?

Thanks for your help
Simon


edit: forgot to use code tags, sry for that
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Capture All text from webpage and copy it... mpatra 3 5,223 07-25-2018, 05:33 PM
Last Post: vimlesh
  Copy folders from ALM squadri 0 1,812 08-16-2016, 06:23 PM
Last Post: squadri
  Need help on excel datatable operations SushantS 1 1,948 12-18-2015, 12:51 PM
Last Post: vinod123
  Need to embed worksheet to already existing excel mahaktikoo 1 2,432 09-27-2012, 12:13 AM
Last Post: krr
  How to copy the content of a variable to clipboard - QTP 10 rohit330 2 17,753 02-22-2012, 08:29 PM
Last Post: rohit330

Forum Jump:


Users browsing this thread: 1 Guest(s)