#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 2nd request

I posted this yesterday with no response. I still have
not figured it out so I thought I would try again. I did
add activeworkbook.save in the close event so the
workbook is now saved before the error message appears. I
get the message after the save but right before the
application closes. Any ideas on what might be causing
this would be greatly appreciated.!
.................................................. ...

I have a program that I designed in excel 2000. When I
run it in 97, there is a glitch. When I double click an
item in a listbox, the code below is ran. It works fine
but when I exit the program I get "excel has errors and
will shut down.." Not a big deal I guess since I was
closing anyway but the program is not saved and it does
not look good. While in the program, everything works as
it should and I won't get the error as long as I don't
double click an item in this listbox. I do not have any
code that runs on close. Anyone have any idea what might
be causing this problem?? Thanks in advance for any help
provided.

Christy

Private Sub lbPending_DblClick(ByVal Cancel As
MSForms.ReturnBoolean)

ufEntry.Hide

'when an item is double clicked in the 'pending
transactions' listbox
'bring up the create userform and populate with the
entries made so far

Dim Rowcnt As Long
Dim r As Long

Rowcnt = 0

For r = 0 To lbPending.ListCount - 1
If lbPending.Selected(r) Then

Rowcnt = r + 2 'listcount begins with 0 and row 1 is
headings so we add 2
'to match the row # with the listindex
#
Dim how As String
how = Sheet2.Range("a" & Rowcnt).Value
Select Case how
Case "ebuy"
ufCreate.obebuy.Value = True
Case "PS7381"
ufCreate.ob7381.Value = True
Case "NA"
ufCreate.obNA.Value = True
End Select
how = ""

Sheet2.Columns("B:B").EntireColumn.Hidden = False
ufCreate.tbApprovalDate.Value = Sheet2.Range("b" &
Rowcnt).Text
Sheet1.Columns("B:B").EntireColumn.Hidden = True


ufCreate.tbOrderDate.Value = Sheet2.Range("c" &
Rowcnt).Text
ufCreate.tbDescription.Value = Sheet2.Range("d" &
Rowcnt).Text
ufCreate.cbCatagory.Value = Sheet2.Range("e" &
Rowcnt).Text
ufCreate.cbVendor.Value = Sheet2.Range("f" &
Rowcnt).Text
ufCreate.tbInvoiceNum.Value = Sheet2.Range("g" &
Rowcnt).Text
ufCreate.tbReceiveDate.Value = Sheet2.Range("h" &
Rowcnt).Text
ufCreate.tbPaidDate.Value = Sheet2.Range("i" &
Rowcnt).Text
ufCreate.cbMethod.Value = Sheet2.Range("j" &
Rowcnt).Text
ufCreate.tbCost.Value = Sheet2.Range("k" &
Rowcnt).Text

'Now remove the transaction from the pending list
'Deleteing something in the rowsource will crash in excel
97

Dim rng As Range

Set rng = Range(lbPending.RowSource)
lbPending.RowSource = ""
Sheet2.Range("a" & Rowcnt).EntireRow.Delete
lbPending.RowSource = rng.Resize(rng.Rows.Count -
1).Address(external:=True)

End If
Next r

Set rng = Nothing

ufCreate.Show

End Sub





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
If then request bpc Excel Worksheet Functions 1 September 22nd 09 06:35 PM
Request Barry Excel Discussion (Misc queries) 1 January 5th 07 06:20 AM
Request chsjk Excel Worksheet Functions 1 January 31st 06 07:40 PM
sql.request teepee Excel Discussion (Misc queries) 2 December 30th 05 01:34 PM
sql.request Ivan Belal Excel Programming 1 September 18th 03 08:24 PM


All times are GMT +1. The time now is 02:45 PM.

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"