Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button won't call macro

Have the following code on one sheet, "detail", and want to activate th
Data Form on the "test" sheet, same workbook.

Sub Button15_Click()

Select Case Application.Caller
Case "Button15"
Worksheets("test").ShowDataForm
End Select
End Sub

When I debug running to cursor, I get a Run-time error "13", typ
mismatch when the cursor is after "showdataform".

Thanks in advance.

Have Excel 2000...........

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button won't call macro

Your Select Case statement is unnecessary. Get rid of it. The proble
you're getting comes from the fact that the "form" you created in th
worksheet is not a "Form" as we generally refer to in Excel. Go int
your VBA editor and on the main menu select Insert--User Form. Wha
gets added is something you could make up to take the same information
but requires you to add all the fields and titles and buttons yourself
From there the information may be placed into the spreadsheet anywher
you'd like. The code you would use to call that form is:

Form1.Show

Though giving it all the functionality you want will be a little (bu
not much) more involved. - Piku

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button won't call macro

Pikus, Have deleted Case. The data form I want to pull up is th
standard data form you get in Excel from the dropdown "Data" the
"Form". The 'test' sheet has the database on it and I want to be abl
to add/subtract to the data base with an update button on the 'detail
sheet.

Deleting Case causes a syntax error with the message "expecting CASE".
Code now looks like:

Sub Button15_Click()
Select Application.Caller
"Button_15"
Worksheets("test").ShowDataForm
End Select
End Sub

but it won't compil

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button won't call macro

I understand. I'm sure there's a way to use that form like you want
but I've never done that. It is possible to create a similar form fro
scratch which you can customize to your project and that is what
could help you with. In the meantime, loose the select statement al
together. Though it will be just as successful, what you've done i
exactly the same as this:

Sub Button15_Click()
Worksheets("test").ShowDataForm
End Sub

To see what I mean, open your VBA Editor, if the Project Viewer is no
visible hit Ctrl + R to open it and click on the project you're workin
on. On the main menu click Insert--User Form and a blank form and
toolbox will appear. This form can be given any entry fields an
layout you want and will be much easier to use for what you have i
mind. If you're interested in learning about this say so, I won't g
into it otherwise. If not, I'm afraid I don't know how to open th
form you're talking about... - Piku

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button won't call macro

Pikus: Bingo! Worked right out of the box. No adjustments needed.
Many thanks for taking the time. Lift Of

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button won't call macro

Any time! Glad to be of service! - Piku

--
Message posted from http://www.ExcelForum.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Button won't call macro

This works for me

Sub Button15_Click()
Worksheets("test").ShowDataForm
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"pikus " wrote in message
...
I understand. I'm sure there's a way to use that form like you want,
but I've never done that. It is possible to create a similar form from
scratch which you can customize to your project and that is what I
could help you with. In the meantime, loose the select statement all
together. Though it will be just as successful, what you've done is
exactly the same as this:

Sub Button15_Click()
Worksheets("test").ShowDataForm
End Sub

To see what I mean, open your VBA Editor, if the Project Viewer is not
visible hit Ctrl + R to open it and click on the project you're working
on. On the main menu click Insert--User Form and a blank form and a
toolbox will appear. This form can be given any entry fields and
layout you want and will be much easier to use for what you have in
mind. If you're interested in learning about this say so, I won't go
into it otherwise. If not, I'm afraid I don't know how to open the
form you're talking about... - Pikus


---
Message posted from http://www.ExcelForum.com/



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
How can run a macro ( call a macro) on selection of any filtercriteria? [email protected] Excel Worksheet Functions 7 February 20th 09 12:34 AM
How can I call IE browser (Back button) through Excel macro? SAM SEBAIHI Excel Discussion (Misc queries) 0 December 14th 06 12:49 AM
How can I call IE browser (Back button) through Excel macro? SAM SEBAIHI Excel Discussion (Misc queries) 0 December 13th 06 04:50 AM
Button fails to call macro when open an Excel via Intranet tigertax Excel Discussion (Misc queries) 1 April 12th 05 10:21 AM
button to call website Andrew Harder Excel Programming 2 November 25th 03 02:27 PM


All times are GMT +1. The time now is 08: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"