Excel 2007 VB to Excel 2003 VB

D

DanF

Howdy

I've got a worksheet I created in Excel 2007, and saved as a .xls (Excel
'97-2003) with a macro that uses the following line of code:


ActiveWorkbook.Worksheets(combinedEMDataTypes).AutoFilter.Sort.SortFields.Clear

When I run the sheet in Excel 2003, it bungs out an error that states
"Object doesn't support this property or method"

I don't think this PC has been updated since it got built as it's supposed
to be 'offline', so would an update fix it, or am I going to have to figure
out another way of making my code work?

Cheers peeps
Dan
 
D

DanF

It's OK, I've changed the code to the way the Office 2003 PC wants to see it.

I hope there isn't any more little surprises like this!
 
J

Jim Rech

I hope there isn't any more little surprises like this!

Why not? Do you think MS should not make object model changes because they
will not work in earlier versions? It would be hard to add features
wouldn't it?

--
Jim
| It's OK, I've changed the code to the way the Office 2003 PC wants to see
it.
|
| I hope there isn't any more little surprises like this!
|
| "DanF" wrote:
|
| > Howdy
| >
| > I've got a worksheet I created in Excel 2007, and saved as a .xls (Excel
| > '97-2003) with a macro that uses the following line of code:
| >
| >
| >
ActiveWorkbook.Worksheets(combinedEMDataTypes).AutoFilter.Sort.SortFields.Clear
| >
| > When I run the sheet in Excel 2003, it bungs out an error that states
| > "Object doesn't support this property or method"
| >
| > I don't think this PC has been updated since it got built as it's
supposed
| > to be 'offline', so would an update fix it, or am I going to have to
figure
| > out another way of making my code work?
| >
| > Cheers peeps
| > Dan
 
D

DanF

Thats not the point my friend.

If you create and save the file as a '97 - '03 format i would expect it to
inform me of possible problems.

There's no need for the condescending comments.
 
J

Jim Rech

No condescension intended. Although Excel does warn of lost features in
Excel proper it does not re VBA code. The Excel warning is for features the
file format itself does not support. The VB file format does support the
retaining of all object methods, etc. It isn't until it arrives in a
specific version of Excel that the problem arises.

Remember that VB changes with every version of Excel and there is no way to
know what version of Excel you will be opening the XLS in. So you'd have to
get a warning for every line of code that wouldn't work in Excel 2003, 2002,
2000 and 97 separately since the XLS file could be opened in any of them.
What a nightmare I'm sure you'd agree, my friend.

--
Jim
| Thats not the point my friend.
|
| If you create and save the file as a '97 - '03 format i would expect it to
| inform me of possible problems.
|
| There's no need for the condescending comments.
|
|
| "Jim Rech" wrote:
|
| > >>I hope there isn't any more little surprises like this!
| >
| > Why not? Do you think MS should not make object model changes because
they
| > will not work in earlier versions? It would be hard to add features
| > wouldn't it?
| >
| > --
| > Jim
| > | > | It's OK, I've changed the code to the way the Office 2003 PC wants to
see
| > it.
| > |
| > | I hope there isn't any more little surprises like this!
| > |
| > | "DanF" wrote:
| > |
| > | > Howdy
| > | >
| > | > I've got a worksheet I created in Excel 2007, and saved as a .xls
(Excel
| > | > '97-2003) with a macro that uses the following line of code:
| > | >
| > | >
| > | >
| >
ActiveWorkbook.Worksheets(combinedEMDataTypes).AutoFilter.Sort.SortFields.Clear
| > | >
| > | > When I run the sheet in Excel 2003, it bungs out an error that
states
| > | > "Object doesn't support this property or method"
| > | >
| > | > I don't think this PC has been updated since it got built as it's
| > supposed
| > | > to be 'offline', so would an update fix it, or am I going to have to
| > figure
| > | > out another way of making my code work?
| > | >
| > | > Cheers peeps
| > | > Dan
| >
| >
| >
 
D

DanF

"So you'd have to get a warning for every line of code that wouldn't work in
Excel 2003, 2002, 2000 and 97 separately since the XLS file could be opened
in any of them."

Yeah, or it could ask you when you first save your file as a '.xls' what
version of Excel you intend to run the spreadsheet on, and set the version of
VB accordingly.

Or if that's not possible, display a warning with a link to a KB article
that can show (or at least point to) the differences between the differing
versions.

Why have the option of saving the file as a '97-'2003 version if it's not
going to work?? Why does it allow me to code macros that aren't recognised in
Excel 2003 - even though I've saved it as a 2003 doc?

I've got a lot of time for Microsoft, and for what they've done for the
software community - Visual Studio is one of my all time favourite bits of
kit - but I think that this needs some attention.
 
P

prachi pandey

Hi,

Can you tell me what was the fix you did to remove this error. I am too getting the same problem.


Thanks
Prachi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top