Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default I got this problem run-time error 1004 application defined ...

This is my code, when i try to add a xlValidateList in an excel sheet
i receive a run time error
1004 application defined or object defined error ...

I tried also to add other lists or formula inside that sheet, it's
possible i've to add something in my project (mmm ...) ??


Private Sub CommandButton1_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim Foglio1 As Worksheet

Dim PathDataBase As String
Dim list As String

'Store the path of the database
PathDataBase = Sheets("Foglio1").Range("E2").Value

' connect to the Access database
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & PathDataBase & ";"

'now find in tblCostruttori and replace in the table
Set rs = New ADODB.Recordset
rs.Open "tblCostruttori", cn, adOpenKeyset, adLockOptimistic,
adCmdTable
lunghezza = rs.RecordCount
lista = ""
Do While (Not rs.EOF)
list = list & rs.Fields("Costruttori") & ";"
rs.MoveNext
Loop
rs.Close
Set rs = Nothing

With Sheets("Foglio1").Range("C2").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween, Formula1:=list
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default I got this problem run-time error 1004 application defined ...


Which line does the macro get stuck on?


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=559840

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default I got this problem run-time error 1004 application defined ...


Which line does the macro get stuck on?


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=559840

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
Problem with calculating time Lee Excel Discussion (Misc queries) 9 March 14th 06 08:53 PM
Ugh..another time and date problem...HELP Sandy Excel Worksheet Functions 4 July 29th 05 05:37 PM
User Defined Variables in MS query cause a problem to import data snb Excel Discussion (Misc queries) 0 April 13th 05 12:16 AM
Defined range problem Pat Excel Discussion (Misc queries) 8 January 17th 05 11:25 AM
Problem with time calc Tom Excel Worksheet Functions 2 November 6th 04 12:04 PM


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