LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Adding validation fails with automation error

I think I have the fix. The problem is that adding validation to a
range fails if there are no cells selected on the worksheet (I
think). Sometimes this code was being called from a command button
click, and the button took the focus away from the underlying sheet,
meaning that adding the validation failed.

I haven't seen any documentation on when you can add validation to a
range, but this poster below ran into the same issue.

http://www.mcse.ms/message734048.html

Philip.

On Feb 12, 4:10 pm, "Jim Cone" wrote:
Phillip,
My guess is that you have other unqualified objects in your code.
The KB you referenced is not devoted to clarity but does provide
clues to most of the Excel automation problems posted in this group.

Do you have object references to...
Excel
The Workbook
The Sheet
The Validation object

Do you Set all objects to Nothing before exiting your code?
Are they set to Nothing in child to parent order?
After exiting your code, have you checked Task Manager to see if
an instance of Excel remains?
--
Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





 
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
Automation error with XLA addin, fails on commandbarbutton onaction [email protected] Excel Programming 0 August 13th 07 07:14 AM
Adding Validation When Source Validates To Error? (PeteCresswell) Excel Programming 4 July 7th 07 10:55 PM
Validation fails on copying x6v87qe Excel Discussion (Misc queries) 3 May 8th 07 09:10 AM
VBA Inserted Data Validation Fails _RickK Excel Programming 3 January 24th 07 05:18 PM
Excel fails to open workbook using Automation from VB 6 Lowell Excel Programming 0 September 8th 05 05:33 AM


All times are GMT +1. The time now is 04:36 PM.

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

About Us

"It's about Microsoft Excel"