Problem with VBA and Macros for Microsoft Excel book.

Alan C23

Board Regular
Joined
May 27, 2002
Messages
72
Don’t even know if this is the right place to ask this question, but I just received a copy of VBA and Macros for Microsoft Excel and downloaded the support files. I hit a wall right off. On page 21, preparing to record the macro, item 4 instructs to select ‘Invoice.txt.’. I had selected all files and when that brought up what I thought was all the files, guess what was missing? That’s right, ‘Invoice.txt.’. Does anyone know what I’m doing wrong, and so early in the book?

This same question was posted on 1/23 by WSIDER under “Missing Sample Files”, with no answer.

Thanks in advance.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi Alan,

Thanks for buying the book!

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.xls, 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
 
code files forVBA and Macros for MS Excel

I bought VBA and Macros for Microsoft Excel just recently. On Page 7 (Next steps) under the heading Code Files is given the address from which to download the code files in the book: *removed by Admin* I keep trying this address and keep getting:"This page cannot be displayed, etc." Is there another address I can use to get these files? Thanks.
 
Adrian - please don't post that address. But if you look carefully at it, you will see you put a period after the "mr"
look at the address of this site - there is no period after mr - it's one word.
 
invoice.txt - where is this file located??????

hi,
I have decided to learn macros and I have bought your book called “Microsoft Excel 2007, VBA & Macros” Bill Jelen, Tracy Syrstad. On the page 47 the book is asking me to open file called INVOICE.TXT but for some reason I can not find it anywhere in my computer and I have been stuck for the past weeeeek! Could you please tell me if there is a mistake in this book or there is another way to retrieve this file.
Leslaw
 
Bill (Mr Excel) discusses that right in this question you posted to. Please carefully read his response from March 16, 2005 above.
 

Forum statistics

Threads
1,222,720
Messages
6,167,835
Members
452,147
Latest member
Ckaplan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top