Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Is this an Excel / VBA Bug (XL 2000) ?

Ok this is a little strange...

If you put a list validation (like 'Y/N' from another range) on a cell, then
using the macro recorder record the following actions:
1) copy
2) select destination range
3) PasteSpecial (choose Validation as the paste option)

stop recording.

You get code like this:
Selection.Copy
Range("F3:F8").Select
Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Now, when you try to run this with 'Option Explicit' there is an error
'variable not defined on the 'xlDatValidation' ! if you try to run it without
Option Explicit, the PasteSpecial method fails...

Not only that, if you search the Object Model (F2) for 'xlDataValidation' it
doesn't exist!

Of course, xlPasteAll works, but it is strange that the macro recorder can
find 'xlDatValidation' but the VBA Compiler can't and neither is it in the
Object Model!

Lovely !

So I say this is a bug - and how do we get it fixed (or is it alright in
XP/2003) ?

thanks

Philip
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Is this an Excel / VBA Bug (XL 2000) ?

I found an answer (you have to use 6 for xlDataValidation)

Selection.PasteSpecial Paste:=6

still, strange that even though the macro recorder can find the enumerated
value, it's not available in the object model and VBA Compiler can't find it
either!

Philip

"Philip" wrote:

Ok this is a little strange...

If you put a list validation (like 'Y/N' from another range) on a cell, then
using the macro recorder record the following actions:
1) copy
2) select destination range
3) PasteSpecial (choose Validation as the paste option)

stop recording.

You get code like this:
Selection.Copy
Range("F3:F8").Select
Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Now, when you try to run this with 'Option Explicit' there is an error
'variable not defined on the 'xlDatValidation' ! if you try to run it without
Option Explicit, the PasteSpecial method fails...

Not only that, if you search the Object Model (F2) for 'xlDataValidation' it
doesn't exist!

Of course, xlPasteAll works, but it is strange that the macro recorder can
find 'xlDatValidation' but the VBA Compiler can't and neither is it in the
Object Model!

Lovely !

So I say this is a bug - and how do we get it fixed (or is it alright in
XP/2003) ?

thanks

Philip

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Is this an Excel / VBA Bug (XL 2000) ?


xlXP records it (properly) as xlPasteValidation.

check Object browser for Enum Excel.XlPasteType



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Philip wrote :

I found an answer (you have to use 6 for xlDataValidation)

Selection.PasteSpecial Paste:=6

still, strange that even though the macro recorder can find the
enumerated value, it's not available in the object model and VBA
Compiler can't find it either!

Philip

"Philip" wrote:

Ok this is a little strange...

If you put a list validation (like 'Y/N' from another range) on a
cell, then using the macro recorder record the following actions:
1) copy
2) select destination range
3) PasteSpecial (choose Validation as the paste option)

stop recording.

You get code like this:
Selection.Copy
Range("F3:F8").Select
Selection.PasteSpecial Paste:=xlDataValidation,
Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False

Now, when you try to run this with 'Option Explicit' there is an
error 'variable not defined on the 'xlDatValidation' ! if you try
to run it without Option Explicit, the PasteSpecial method fails...

Not only that, if you search the Object Model (F2) for
'xlDataValidation' it doesn't exist!

Of course, xlPasteAll works, but it is strange that the macro
recorder can find 'xlDatValidation' but the VBA Compiler can't and
neither is it in the Object Model!

Lovely !

So I say this is a bug - and how do we get it fixed (or is it
alright in XP/2003) ?

thanks

Philip

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Is this an Excel / VBA Bug (XL 2000) ?

I did - it is not there in Excel 2000 ... like I said in my original
post...neither xlPasteValidation nor xlDataValidation

"keepITcool" wrote:


xlXP records it (properly) as xlPasteValidation.

check Object browser for Enum Excel.XlPasteType



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Philip wrote :

I found an answer (you have to use 6 for xlDataValidation)

Selection.PasteSpecial Paste:=6

still, strange that even though the macro recorder can find the
enumerated value, it's not available in the object model and VBA
Compiler can't find it either!

Philip

"Philip" wrote:

Ok this is a little strange...

If you put a list validation (like 'Y/N' from another range) on a
cell, then using the macro recorder record the following actions:
1) copy
2) select destination range
3) PasteSpecial (choose Validation as the paste option)

stop recording.

You get code like this:
Selection.Copy
Range("F3:F8").Select
Selection.PasteSpecial Paste:=xlDataValidation,
Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False

Now, when you try to run this with 'Option Explicit' there is an
error 'variable not defined on the 'xlDatValidation' ! if you try
to run it without Option Explicit, the PasteSpecial method fails...

Not only that, if you search the Object Model (F2) for
'xlDataValidation' it doesn't exist!

Of course, xlPasteAll works, but it is strange that the macro
recorder can find 'xlDatValidation' but the VBA Compiler can't and
neither is it in the Object Model!

Lovely !

So I say this is a bug - and how do we get it fixed (or is it
alright in XP/2003) ?

thanks

Philip


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Is this an Excel / VBA Bug (XL 2000) ?

xl2000 was missing the columnwidth constant for paste special as well (
value: 8) as an example. So yes, I am sure it is a bug. the macro
recorder doesn't really record "dynamically". It is furnished fixed
information on what to record for each action. So apparently the recorder
people were led to believe the constant would be defined, but the constant
people never got around to implementing it would be my take.

--
Regards,
Tom Ogilvy

"Philip" wrote in message
...
I did - it is not there in Excel 2000 ... like I said in my original
post...neither xlPasteValidation nor xlDataValidation

"keepITcool" wrote:


xlXP records it (properly) as xlPasteValidation.

check Object browser for Enum Excel.XlPasteType



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Philip wrote :

I found an answer (you have to use 6 for xlDataValidation)

Selection.PasteSpecial Paste:=6

still, strange that even though the macro recorder can find the
enumerated value, it's not available in the object model and VBA
Compiler can't find it either!

Philip

"Philip" wrote:

Ok this is a little strange...

If you put a list validation (like 'Y/N' from another range) on a
cell, then using the macro recorder record the following actions:
1) copy
2) select destination range
3) PasteSpecial (choose Validation as the paste option)

stop recording.

You get code like this:
Selection.Copy
Range("F3:F8").Select
Selection.PasteSpecial Paste:=xlDataValidation,
Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False

Now, when you try to run this with 'Option Explicit' there is an
error 'variable not defined on the 'xlDatValidation' ! if you try
to run it without Option Explicit, the PasteSpecial method fails...

Not only that, if you search the Object Model (F2) for
'xlDataValidation' it doesn't exist!

Of course, xlPasteAll works, but it is strange that the macro
recorder can find 'xlDatValidation' but the VBA Compiler can't and
neither is it in the Object Model!

Lovely !

So I say this is a bug - and how do we get it fixed (or is it
alright in XP/2003) ?

thanks

Philip




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
I cannot edit cell format in Excel 2000 (Part of office 2000)! Brett Excel Discussion (Misc queries) 1 April 12th 06 05:58 PM
Hyperlink in Excel 2000 can't open bookmarked Word 2000 file DCheslock Excel Discussion (Misc queries) 1 May 5th 05 10:46 PM
Excel Programs developed in Office 2000 on Windows 2000 Trooper Excel Discussion (Misc queries) 4 March 12th 05 11:09 PM
Create macro to download access 2000 table to excel 2000 spreadsheet Tushar[_2_] Excel Programming 3 October 21st 04 02:44 PM
Code-signing certificate problems in Excel 2000 with Windows 2000 Aaron Queenan Excel Programming 0 May 6th 04 11:35 AM


All times are GMT +1. The time now is 01:24 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"