Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 25th, 2005, 10:16 AM
Authorized User
 
Join Date: Jan 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Form Display

Hi, all Ye Gurus!
                  I created an image on a worksheet. If I move the mouse cursor/pointer over that particular image, there should display a customized Form.
                 Can this be done? How are the codes to be written for the mouse cursor/pointer to execute the procedure?

                    Appreciate your ideas and help.

  CHIN

 
Old January 25th, 2005, 11:59 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Unfortunately the mouseover event is not available in Excel, do you need this to work in this manner or can you survive with a click of the object/picture?

Cheers

Matthew

 
Old January 28th, 2005, 11:18 AM
Authorized User
 
Join Date: Jan 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks again Matthew.
It would be quicker to view the form and select in this way rather than to wait until the next page/form is displayed.

CHIN
 
Old February 1st, 2005, 05:42 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

It can be done by this way

Private Sub Image1_MouseMove(ByVal Button As Integer, _
        ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim b As Byte

b = b + 1
If b <= 1 Then
    UserForm2.Show
End If

End Sub

-vemaju

 
Old February 1st, 2005, 05:47 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Which version of Excel are you using Vemaju?

Matthew

 
Old February 1st, 2005, 06:27 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

Currently I'm using Excel 2003, but I suppose it's working in any version beginning from 97

-vemaju

 
Old February 1st, 2005, 06:39 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have checked out MSDN and found that the mousemove event should only work with a chart object, I can't get it to work for my XL2K with an image object. How have you got it to work for an image? Have you declared you image as a collection? I really am interested.

Cheers

Matthew

 
Old February 1st, 2005, 07:01 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry
I misread the question. I thought it was question about forms.
I added image control to the form and the image conrol has a mousemove event.

-vemaju



 
Old February 1st, 2005, 07:07 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found a solution

Add an image control from Control Toolbox to the worksheet.
Add a picture to that control.
Image control has an MouseMove event where you put your code to open a custom UserForm

I hope this works

-vemaju

 
Old February 1st, 2005, 07:41 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Excellent solution. I had forgotten about using control images rather than regular images. It now works for me, but I dont know about Chin whose question it was.

cheers

Matthew






Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Form Display Morn ASP.NET 2.0 Basics 0 March 13th, 2007 03:30 PM
display excel sheet in form Kaustav Pro VB 6 0 March 8th, 2006 02:07 AM
Display icon and form caption vickyj Beginning VB 6 1 January 31st, 2006 05:55 AM
Display form only acctlchr Access 6 May 6th, 2004 07:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.