MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 9th, 2002, 12:25 PM   #1
charlie79
Board Regular
 
Join Date: Feb 2002
Posts: 97
Default

Please help!

I've been pulling my hair out over this for a couple hours now, and can't figure it out. Here's the prob, I have an excel app that is runable in xl97 and xl2k. I'm using the click event of a label to bring up a userform with a combobox containing records from an access db. The user then selects one of the records, the userform "hides" and I then calculate a specific range of about 100 cells, base on the choice the user made from the form. Follow me? Well, here's where the problem lies. From my laptop, pIII 1.13Ghz 256MG Ram, it all works fine (xl2k). From a PI 166 64MG Ram, it dies if I click on the label right after the form "hides" (xl97). Only if I click the label right away after the form hiding. Anybody follow this? I sure hope so cuz I'm about to give up here....


Thanks in advance.


__________________
How long a minute is depends on which side of the bathroom door you are standing...

Cheers
charlie79 is offline   Reply With Quote
Old May 9th, 2002, 01:37 PM   #2
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,065
Default

ill look into techio side

suggest pos the code script so we can all see it and help if we can

Jack
__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old May 9th, 2002, 01:43 PM   #3
charlie79
Board Regular
 
Join Date: Feb 2002
Posts: 97
Default

Here you go, not sure if can make sense of this, sometimes I can't.


*********************************************

Private Sub lblSelectGrade_Click()
Cells(1, 1).Select
frmSimulator.Show
End Sub

******************************************************

Private Sub UserForm_Initialize()

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

statement = "SELECT grade FROM grades" & Chr(0)

Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDBPath & ";"
Set rs = New ADODB.Recordset
Set rs = cn.Execute(statement, , adCmdText)

cboGrades.Clear
Do While Not rs.EOF
cboGrades.AddItem rs!grade
rs.MoveNext
Loop
cboGrades.ListIndex = 0

End Sub

******************************************************
'cboGrades is the combobox

Private Sub cboGrades_Change()
frmSimulator.Hide
Sheet1.lblSelectGrade.Caption = cboGrades.Value
Call SimTarget(strDBPath, "V_EXCEL_EXPORT", Cells(19, 1))
End Sub


******************************************************

Sub SimTarget(DBFullName As String, TableName As String, TargetRange As Range)
On Error GoTo SimTarget_err
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim statement As String
Dim intAppRow As Integer
Dim intTrgRow As Integer
Dim success As Boolean

Sheet1.Unprotect "hmx"
intAppRow = 7
success = False
statement = "SELECT * FROM V_EXCEL_EXPORT"

Set TargetRange = TargetRange.Cells(1, 1)
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & DBFullName & ";"
Set rs = New ADODB.Recordset

Set rs = cn.Execute(statement, , adCmdText)
rs.MoveFirst

'Populate targets for Sim Grade
rs.MoveFirst
intAppRow = 7
For intTrgRow = 7 To 48
While success = False
If rs.EOF Then
Cells(67, intTrgRow).Value = " "
intAppRow = intAppRow + 1
success = True
ElseIf Cells(3, intAppRow).Value = rs!app_desc And Sheet1.lblSelectGrade.Caption = rs!grade Then
Cells(67, intTrgRow).Value = rs!target
intAppRow = intAppRow + 1
success = True
End If
If Not rs.EOF Then
rs.MoveNext
End If
Wend
success = False
rs.MoveFirst
Next intTrgRow
Call SimBatch

'Close everything
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Sheet1.Protect "hmx"
SimTarget_err:
Exit Sub
End Sub

********************************************



_________________
How long a minute is depends on which side of the bathroom door you are standing...

Cheers

[ This Message was edited by: charlie79 on 2002-05-09 12:44 ]
charlie79 is offline   Reply With Quote
Old May 9th, 2002, 01:54 PM   #4
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

When you say "it dies", are you getting a runtime error, Excel will now be put to death error, or what?
Tom
Tom Schreiner is offline   Reply With Quote
Old May 9th, 2002, 02:00 PM   #5
charlie79
Board Regular
 
Join Date: Feb 2002
Posts: 97
Default

The good 'ole Dr. Watson (being run in NT, xl97) xl will be put to death error...
__________________
How long a minute is depends on which side of the bathroom door you are standing...

Cheers
charlie79 is offline   Reply With Quote
Old May 9th, 2002, 02:12 PM   #6
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,065
Default

suggest open on lap top and save as another name in version 2000b then try on other PCs lap tops.

thisis from the evedence you give,

think exel getting grumpy.

make sure to save as correct current verson 97 2000 are OK


__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old May 10th, 2002, 06:15 AM   #7
charlie79
Board Regular
 
Join Date: Feb 2002
Posts: 97
Default

I'll try that, however I don't think it's going to work since I have three workbooks that are pretty much the same, and they all do it.

Didn't work... Any other ideas?

[ This Message was edited by: charlie79 on 2002-05-10 05:41 ]
charlie79 is offline   Reply With Quote
Old May 10th, 2002, 07:04 AM   #8
crimlet
Board Regular
 
Join Date: May 2002
Location: Ipswich, Suffolk, England
Posts: 135
Default

up grade your other PC
crimlet is offline   Reply With Quote
Old May 10th, 2002, 07:10 AM   #9
charlie79
Board Regular
 
Join Date: Feb 2002
Posts: 97
Default

Wow, I can't believe I didn't think of that before... What a great idea... ?????

Obviously, that's not an option!



__________________
How long a minute is depends on which side of the bathroom door you are standing...

Cheers
charlie79 is offline   Reply With Quote
Old May 10th, 2002, 08:51 AM   #10
charlie79
Board Regular
 
Join Date: Feb 2002
Posts: 97
Default

What do you think folks??

Any ideas?



__________________
How long a minute is depends on which side of the bathroom door you are standing...

Cheers
charlie79 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 05:43 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes