View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default Object Error: what am i doing wrong??

firstly, unless i'm blind i didn't find any 's. :) so i don't
know where it's erroring.

a first thought is shouldn't Dim lFiledate As Long be Dim IFiledate as
Date?

0 If lFiledate = 0 Then why is the first zero there? that would make it error.


i have some possible ideas about sDateExtract but i'm not sure so i'll
keep my mouth shut for now about those..... :)
hope this helps
susan
(ps - & i learn most of my vba thru trial & error, too!)


On Mar 23, 8:34 am, "artisdepartis" wrote:
Dear Experts, in my quest to explore macro's I am currently lost. I
learn mostly by creative copy pasting and a lot of trail and
error... ;-) However, i am... stuck. Is there anyone who can review my
code and tell me why I get an error telling me the 'Object does not
support the property or method'. The lines generating this error have
been put between
(I copied this from a sheet where i use this also and it does work!)

Sub Write_Results()

Dim sDateExtract As String
Dim FoundCell As Range
Dim lFiledate As Long
Dim rLastSplitsPerAI As Range
Dim LSPAI As Long
Dim sFileNameResults As String

0 If lFiledate = 0 Then
lFiledate = InputBox("Enter date of reportation. (yyyymmdd)")
MsgBox "You will create the SE Report for " & lFiledate
Else
End If

sFileNameResults = "SE statistiek " & lFiledate & ".xls"
LSPAI = 126
Set rLastSplitsPerAI = Range(Cells(3, 1), Cells(3, LSPAI))
sDateExtract = Mid(lFiledate, 5, 2) & "/" & Right(lFiledate, 2) & "/"
& Left(lFiledate, 4)
MsgBox sDateExtract
Windows("overview_f.xls").Activate
Sheets("SPAI").Select

Set FoundCell = Range("A1:A800").Find _
(What:=DateValue(sDateExtract), LookIn:=xlFormulas)
If FoundCell < "" Then



Workbooks("overview_f.xls").Sheets("SPAI").Range(C ells(FoundCell.Row,
2), Cells(FoundCell.Row, 127)).Value _
= Workbooks(sFileNameResults).Sheets("SPAI").rLastSp litsPerAI.Value



Else
MsgBox "Oops... something went wrong, check things manually plz."
End If

End Sub