Kent Cassidy

Kent Cassidy

  • NA
  • 19
  • 1.3k

Calling a window, passing data back, within a loop

Jan 29 2016 12:39 PM
Hi,
 
I have an WPF that I am writing where I allow the user to open one to many Excel workbooks and then I do some data cleaning and write out a text file.
 
Now I need to take in account that there may be multiple sheets withing the one workbook.  I have written Excel macros where I the user to picks multiple workbooks from an open dialog and then in code I perform a loop that opens 1 workbook at a time, checks for multiple worksheets, if there are multiple sheets open a form that lists all sheets and the user can pick the ones they want to use.  Then in code a do a loop based on this selection.  I would like to duplicate this in a WPF using C#.  I'm not sure if you can open a window while looping and pass the list back to use in the code. 
 
Any advice would be greatly appreciated.
 
Thank you,
Kent