Combination Macro Example: Creating A Report for Each Customer

ElizabethN

New Member
Joined
Jul 10, 2009
Messages
19
Using Microsoft Office Excel 2007, pp. 998-1004

I'm trying to use the code from this example to create a series of reports.

This macro creates the first report just fine; however, it stops after creating the first report & won't move on to the next customer. It gives me the following error in the Microsoft Visual Basic dialog box:

*************************************
Run-time error '438':

Object doesn't support this property or method.

Continue End Debug Help
*************************************

When I click "Debug", it takes me to the line of code that reads "WBN.Select" (the very last line of code).

What could be the problem?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi Elizabeth

Thanks for your note. I checked out that code.

Change the last line from
WBN.Select
to
WSO.Select

WBN is the object variable for the report for one particular customer. The code just saved and closed that workbook a few lines ago. This is a typo in the book.

Thanks for pointing this out. I will start rewriting this book for Excel 2010 in the next week. This is a timely note.

Bill Jelen
 
Thank you, Bill! I'll try it out.

I am really enjoying this book & your VBA macro book, btw. Your writing makes this stuff much easier to learn. :)
 
Bill:

Your fix worked great for getting the program to cycle through the dealers. I am having one additional problem. When I go to open the report file created by the program, I get the following error message.

----------------------------------------------------------
(Warning Symbol) "The file you are trying to open, "CUSTOMER NAME", is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"

Yes No Help
---------------------------------------------------------

If I click "Yes", the file opens right up; however, if I send it to customers, they find the prompt a little alarming. Is there a way to eliminate it?

Thanks for your help.
 

Forum statistics

Threads
1,222,723
Messages
6,167,850
Members
452,149
Latest member
gatje

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