In the course of Chapter 1, there are three different versions of invoice.txt. The key concept requires that you have three different versions of this file, each with more or less records than the first day. Newer versions of Invoice.txt are used in Chapter 2. In all, there are five needed versions of Invoice.txt.
I could not figure out how to include all five versions of invoice.txt, because each day, the program expects the file to be called "invoice.txt".
The important concept here is not the Import step. The important concept is what happens immediately after the import. So - the solution - I commented out the line of code that does the import. I already ran the import line on four different worksheets in the workbook.
Look at ProjectFilesChapter01.xls. The worksheet called InvoicesMonday contains the original Invoice.txt. Put the cellpointer in A1 and press the button in C16 to run the macro on the original version of invoices.txt. The macro will work fine, just like it will work on every day that there are 13 records in the file.
Next, look at the worksheet called InvoicesTuesday. I've already imported a longer version of invoices.txt into this worksheet. Put the cellpointer in A1. Run the macro by pressing the button in C21. You will see that the macro fails as described in the book.
The book takes a look to see if relative references would solve the problem. This version of the macro can be tested on Invoices Tuesday (2). Put the cellpointer in A1, run the macro by pressing the button in C21.
The final version of invoices.txt has been imported to the next worksheet, called InvoicesWednesday.
In ProjectFilesChapter02, I used a similar strategy on the worksheets called Page42 and Page58. The invoice.txt file has been imported to the worksheet and the import line is commented out.
Bill Jelen