Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to validate the worksheet name / file name of Excel and CSV files in WATiR?

Because if we save the CSV file in with different name, the worksheet name will also change while in Excel it will remain the same.

How we can find the File name if we will open the file?

share|improve this question
Do you have a piece of code to demonstrate what you are working on? – dzieciou Jan 23 '13 at 7:27

Although I haven't had to do this in a few years, I always found the win32OLE to be my best friend in these cases. Can't seem to find any of my old code samples. Doing a quick search, I came across a fairly good tutorial here by David Sulc with this particular post seeming to cover exactly what you're looking for.

share|improve this answer

Watir drives browsers. Since you are using Watir my guess is that you are using Ruby. If you need to access Excel files you will have to use another tool, roo for example.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.