Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
corrupt Excel 2000/2002 files | Excel Discussion (Misc queries) | |||
Excel 2000 to 2002 - #NAME? | Excel Discussion (Misc queries) | |||
Excel 2000 to 2002 - #NAME? | Excel Discussion (Misc queries) | |||
Excel Macros from 2000 to XP 2002 | Excel Programming | |||
Excel 2000-2002 compability | Excel Programming |