View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
William[_2_] William[_2_] is offline
external usenet poster
 
Posts: 227
Default VBA Code Works in 97, Not in 2002

Hi Ron, Dave

In the original code posted, the line
Sheets("NewInquiryForm").Name = "Inquiry Form"
did have a trailing space
Sheets("NewInquiryForm").Name = "Inquiry Form "

Like Dave, I did not recreate the environment to run the entire macro but if
the original code you posted ran without problem in a different workbook,
then you should step through that code line by line in the "real" workbook
to identify where the first error is.

--
XL2002
Regards

William


"Dave Peterson" wrote in message
...
| Ahh. I see why you were hesitant.
|
| I skinnied down your code to just the apply_format section and that
portion
| worked ok for me (xl2002/win98).
|
| But this section looked plenty weird to me:
|
| Sheets("Inquiry Form ").Activate
| '
| ActiveWindow.SelectedSheets.Delete
| Sheets("NewInquiryForm").Activate
| '
| Sheets("NewInquiryForm").Name = "Inquiry Form"
|
| You delete "inquiry From " (with a trailing space) and rename the
| "newinquiryform" to "inquiry form" without the trailing space.
|
| With the "on error resume next" still active, maybe that caused the error.
|
| With all the workbooks and folders that it uses, I don't think I'd want to
| recreate the environment to make testing worthwhile.
|
| But if I were debugging this, I'd turn off all "on error resume next"
lines
| (looks like you got both). And I'd turn off all the
"application.displayalerts
| = false" lines. I'd step through the code with F8's (answering the alert
| warnings nicely).
|
| It might help find it.
|
| Sorry about not being any real help.
|
| Good luck,
|
|
|
|
|
| EC wrote:
|
| --
|
| Dave Peterson
|