#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default vba

Mike,

I was able to reproduce this behaviour when running the code from an ActiveX command button. If this is your problem, I suggest
using a Forms toolbar command button to run yor macro.

--

John Green - Excel MVP
Sydney
Australia


"Mike Cooper" wrote in message om...
Hi

I am sure there is a simple answer to this. I have the following
code:

Sub Input_Message()
With Worksheets("Master Schedule").Range("g5").Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "dd"
.ErrorTitle = ""
.InputMessage = "It works"
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

End Sub

...Which works perfectly well as a macro. However, I need it as a
subroutine that is called by another subroutine. In that function the
exact same code gets the generic "Application-Defined or
Object_Defined Error" which lands on the line of code right after
.delete. If I cut that line out the error lands on the line below
that and so forth. What am I missing here??!!

Thank you,
Mike Cooper



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



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