Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 2000 vs 2002 xConstants

I created a workbook on Excel 2002 and in some procedure or another there
was a line something like this...

.. . .
some_range.PasteSpecial xlPasteColumnWidths
.. . .

I put the .xls file on a machine that was using Excel 2000 and this line
generates an error indicating that it doesn't understand the constant
'xlPasteColumnWidths'.

Fine says I, let's see what it does understand, so I add a new worksheet,
just to be careful,
select a range on it,
copy it, select another like-minded range,
turn on macro recording,
invoke pastespecial and select column widths,
turn off macro recording and go look at the macro thus created.

Most interesting that the pastespecial in the recorded macro refers to the
constant 'xlColumnWidths', not 'xlPasteColumnWidths'. When I take a look at
the value of xlColumnWidths, it seems to be defined but it's empty.

Returning to my Excel 2002 environment, it's never heard of xlColumnWidths.
Moreover xlPasteColumnWIdths has a value of 8.

I have no idea of the provenance of the Excel 2000 on the experimental
machine. None, nada ,zip, zero.

What gives?

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 2000 vs 2002 xConstants

in both xl2k and xl2002, 8 will work instead of xlpastecolumnwidths.

From the immediate window in xl2002:

?xlColumnWidths
(returned nothing)
?xlPasteColumnWidths
8

http://support.microsoft.com/default...;EN-US;Q231090
XL2000: "PasteSpecial method of Range class failed" Error When Running a
Macro

Terry von Gease wrote:

I created a workbook on Excel 2002 and in some procedure or another there
was a line something like this...

. . .
some_range.PasteSpecial xlPasteColumnWidths
. . .

I put the .xls file on a machine that was using Excel 2000 and this line
generates an error indicating that it doesn't understand the constant
'xlPasteColumnWidths'.

Fine says I, let's see what it does understand, so I add a new worksheet,
just to be careful,
select a range on it,
copy it, select another like-minded range,
turn on macro recording,
invoke pastespecial and select column widths,
turn off macro recording and go look at the macro thus created.

Most interesting that the pastespecial in the recorded macro refers to the
constant 'xlColumnWidths', not 'xlPasteColumnWidths'. When I take a look at
the value of xlColumnWidths, it seems to be defined but it's empty.

Returning to my Excel 2002 environment, it's never heard of xlColumnWidths.
Moreover xlPasteColumnWIdths has a value of 8.

I have no idea of the provenance of the Excel 2000 on the experimental
machine. None, nada ,zip, zero.

What gives?

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 2000 vs 2002 xConstants

This was a bug in xl2000

use the hardcoded value 8

the option to pastespecial columnwidths was introduced in xl2000, so it
isn't in xl97.

--
Regards,
Tom Ogilvy

Terry von Gease wrote in message
...
I created a workbook on Excel 2002 and in some procedure or another there
was a line something like this...

. . .
some_range.PasteSpecial xlPasteColumnWidths
. . .

I put the .xls file on a machine that was using Excel 2000 and this line
generates an error indicating that it doesn't understand the constant
'xlPasteColumnWidths'.

Fine says I, let's see what it does understand, so I add a new worksheet,
just to be careful,
select a range on it,
copy it, select another like-minded range,
turn on macro recording,
invoke pastespecial and select column widths,
turn off macro recording and go look at the macro thus created.

Most interesting that the pastespecial in the recorded macro refers to the
constant 'xlColumnWidths', not 'xlPasteColumnWidths'. When I take a look

at
the value of xlColumnWidths, it seems to be defined but it's empty.

Returning to my Excel 2002 environment, it's never heard of

xlColumnWidths.
Moreover xlPasteColumnWIdths has a value of 8.

I have no idea of the provenance of the Excel 2000 on the experimental
machine. None, nada ,zip, zero.

What gives?

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
corrupt Excel 2000/2002 files Ohio Doug Excel Discussion (Misc queries) 0 November 21st 05 03:35 PM
Excel 2000 to 2002 - #NAME? Paulo Freixieiro Excel Discussion (Misc queries) 6 September 7th 05 01:33 PM
Excel 2000 to 2002 - #NAME? Paulo Freixieiro Excel Discussion (Misc queries) 1 September 7th 05 01:12 AM
Excel Macros from 2000 to XP 2002 Donald Hohler Excel Programming 0 August 27th 03 03:59 PM
Excel 2000-2002 compability Chrissy[_4_] Excel Programming 5 August 3rd 03 04:24 AM


All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"