PDA

View Full Version : Error 2147417848 (80010108)



MBESSANT
02-24-2009, 03:22 AM
I have made a userform in excel and used command buttons to control different macros. Error 2147417848 (80010108) keeps on closing Excel.

What am i doing wrong?:banghead:

I know the code is written very well its my second time a writing code.

Thanks for helping


Sub BPOK()
Selection.Cut
Sheets("Made").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Need").Select
Selection.Delete Shift:=xlUp
BoatPick.Hide
Call SortMade
Call SortNeed
Sheets("Need").Select
End Sub

Sub SortMade()
Sheets("Made").Select
Columns("A:F").Select
Selection.Sort Key1:=Range("D1"), Order1:=xlAscending, Key2:=Range("A1") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A1").Select

End Sub


Sub SortNeed()
Sheets("Need").Select
Columns("A:F").Select
Selection.Sort Key1:=Range("D1"), Order1:=xlAscending, Key2:=Range("A1") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A1").Select
End Sub

Sub Blem()
Selection.Copy
Sheets("Need").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Made").Select
Range("A" & BoatReturn.ListBox1.ListIndex + 2).Select
With ActiveCell
Cells(.Row, "B").Select
Application.CutCopyMode = False
Selection.Value = ("BLEM")
End With
Call SortMade
Call SortNeed
BoatReturn.Hide
End Sub

Sub Scrap()
Selection.Copy
Sheets("Need").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Scrap").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Made").Select
Range("A" & BoatReturn.ListBox1.ListIndex + 2).Select
With ActiveCell
Cells(.Row, "B").Select
Application.CutCopyMode = False
Selection.Value = ("SCRAP")
End With
Call SortMade
Call SortNeed
BoatReturn.Hide

End Sub
Sub UK1st()
Selection.Copy
Sheets("Need").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Made").Select
Range("A" & BoatReturn.ListBox1.ListIndex + 2).Select
With ActiveCell
Cells(.Row, "B").Select
Application.CutCopyMode = False
Selection.Value = ("UK1st")
End With
Call SortMade
Call SortNeed
BoatReturn.Hide
End Sub

Simon Lloyd
02-24-2009, 04:28 AM
I have made a userform in excel and used command buttons to control different macros. Error 2147417848 (80010108) keeps on closing Excel.

What am i doing wrong?:banghead:

I know the code is written very well its my second time a writing code.

Thanks for helpingOn the contrary, your code is NOT very well written, you need to get rid of all those Selects, they're not needed, you have multiple userforms open where you don't need to, in fact you don't unload them, you copy a selection paste it then immediately delete it!, the sorts can be done using Sheets(Array(...etc

Do yourself a favour and start again!

Bob Phillips
02-24-2009, 07:44 AM
On the contrary, your code is NOT very well written, you need to get rid of all those Selects, they're not needed, you have multiple userforms open where you don't need to, in fact you don't unload them, you copy a selection paste it then immediately delete it!, the sorts can be done using Sheets(Array(...etc

:boxer2: ouch!

I think it was a typo, I think that he meant that he knew it was NOT well written, at least I hope so.

Simon Lloyd
02-24-2009, 12:11 PM
:boxer2: ouch!

I think it was a typo, I think that he meant that he knew it was NOT well written, at least I hope so.Hmmmm, must have been my frame of mind at the time, it seemed odd that he thought second time of writing a macro made you an expert, i really wish it did!, oh the things i could achieve ;), anyway.....if thats the case MBESSANT i apologise!!!