473,395 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Excel VBA userform.show does not display form locks excel

I am using a selection_change event on a worksheet to launch a userform that will populate the cell when a selection is made from a drop down list box on the form. Selection_change shows form if cell to the left of the active cell meets a certain condition and the active cell is in column 8.

Problem: when conditions warrant, selection_change shows userform. when executed Excel locks. VBA editor indicates code is running but form can not be seen.

Some Details: This is a very large spreadsheet with lots of formating in the cells, borders, etc. Sheets are protected to select unlocked cells, edit objects, edit senarios, insert hyperlinks. worksheets contain several command buttons and a calendar 11.0 control. Worksheet only navigable using controls and forms, Hidden items: AllToolbars, some right click menu items, sheet tabs, horizontal scroll bar. All sheets set to same zoom level(80%). forms are launched so as not to be atop other controls. all sheets reached by controls contain activate, change, and selection_change events.

Contents:
worksheets: 34
named ranges:45
userforms:24 (all modal)
modules:11

Using Excel2003 on XP pro >2gig Ram

Problematic code:
If CCol = 8 And UCase(Cells(CRow, "E").Value) = "X" Then
If ActiveCell.Value <> "" Then
resp = MsgBox("Do you want to replace " & ActiveCell.Value & " as the responsible party" & vbCr & "to complete Task" & ActiveCell.Row & "?", vbYesNo)
If resp = vbYes Then GoTo showit
If resp = vbNo Then GoTo dont
End If
showit:
With UserForm3.Label1
.Caption = "Assign a resource to complete task " & ActiveCell.Row & "."
End With
With UserForm3
.Left = ActiveCell.Left + 35
.Top = ActiveCell.Top
.Show '<-----code and excel locks on this instruction
End With
dont:
changeflag = False

Any ideas please? This has driven me nuts. The real kicker is that the code works on a different sheet. I have written the code to be able to copy from sheet to sheet without need of change.
Jun 27 '07 #1
2 12490
kadghar
1,295 Expert 1GB
Im not sure if it should cause any problem, but have you checked that the startupposition of the form is set to manual?? if not, just put something like:

Expand|Select|Wrap|Line Numbers
  1. With UserForm3
  2. .StartUpPosition = 0
  3. .Left = ActiveCell.Left + 35
  4. .Top = ActiveCell.Top
  5. .Show '<-----code and excel locks on this instruction
  6. End With
Anyway, i dont think that should have been a problem... if it wasn't set that way the form should only have been displayed somewhere else.
(I dont see any other problem with that very part of your code)

Hope that helps.
Jun 27 '07 #2
kadghar,

I did have userform3 set to manual. I may go back and try your fix but found it all works fine when set to center screen. I was trying to move the form to be near the cell it was to pupulate. what appears to have been hapening is that the form loaded but seemed to be tied to the previous cell as the userform launched from a selection change event. I I realized after I posted that the activate code that caused the change event may have been many rows away from the target cell (the page it worked fine on uses only 40 rows, those it did not work on had several hundred. On a whim, when the code seemed to lock, I used the down arrow and return and the cell was populated without problem. I decided to leave out the move it to the cell gimic.

Many thanks for the quick response.

J
Jun 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Matthew Wieder | last post by:
I have the following requirements: Build a stand-alone C# application that asks the user to click in a cell in an Excel spreadsheet, and then displays the address of that cell in the C#...
1
by: garry.oxnard | last post by:
Can anyone help me to solve a problem which involves switching from Access to Excel (then back to Access) programatically please? I have an Excel template which, on open, also opens an Access...
3
by: gw.boswell | last post by:
I have created a userform with textboxes for data entry. I also have a command button that calls a second useform. A user enters certain information in the first useform but if he/she wants to do...
1
by: elLiven | last post by:
Hi I'm trying to learn VBA in Excel mysel. Getting stuck on userforms. I can create a userform with optionbuttons and command buttons. I want to know how to have the form display the...
7
Merlin1857
by: Merlin1857 | last post by:
Its great producing data for users to look at in your web pages and generally that is sufficient for their needs but sometimes you may want to supply your user with the data in a form they can...
1
by: brenty66 | last post by:
I have a userform that is used as an interface for information stored on excel spreadsheets. The user enters bits of information into fields on the userform which are place on the corresponding...
3
by: brenty66 | last post by:
I have a userform used as an interface to store information on excel spreadsheets. I have put a decent amount of work into it to this point and all of a sudden I am getting a catastrophic error...
1
by: Pippy Parker | last post by:
I've created a Userform within an Excel session which is populated by various pieces of info. What I'm looking to do is exported the Userform into a jpeg which I then can attach to a e - mail. ...
3
by: mforema | last post by:
Hello, I have a userform in Excel with a textbox and cmd button. I want to give the user the ability to search for a specific worksheet name within an Excel Workbook. My code for the cmd button...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.