|
-
Jun 2nd, 2011, 05:41 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Run time error 1004, can't figure it out
So I'm nowhere near a professional VBA developer here, but I've done this before for working with huge spreadsheets at a previous job and didn't feel this dumb.
I keep getting the run time error 1004: Application-defined or object-defined error
and this is all I have:
Code:
Sub dosomething()
Sheet1.Activate
Sheet1.Visible = True
Sheet1.Select
Dim i As Integer
For i = 0 To 10 'Sheet1.Rows.Count
If Sheet1.Cells(i, 6) <> "" Then
Sheet1.Cells(1, 12) = Sheet1.Cells(1, 12) + Chr(13) + "duh = ListView1.ListItems.Add(,," + Sheet1.Cells(i, 1) + ")"
End If
Next i
End Sub
I've tried searching, but to no avail thus far. The only thing I came up with from searching was the first part, using activate visible and select, but that didn't fix it.
In case anyone is wondering, I have an excel sheet and I want to import all of the values into a multi-column listview in VB, which I have working but it is slow because it's opening the workbook to pull the values. I want to produce code to load the information in directly from my project so I don't have to have the additional excel workbook. I was testing my first few lines of code to make sure I remembered what I was doing, and have spent the last 30 minutes frustratingly searching for why this won't work. Please help
Thank you in advance,
Eric
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|