 |
BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2
 | This is the forum to discuss the Wrox book Excel 2007 VBA Programmer's Reference by John Green, Stephen Bullen, Rob Bovey, Michael Alexander; ISBN: 9780470046432 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2 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
|
|
|
|

November 2nd, 2007, 11:13 AM
|
|
Authorized User
|
|
Join Date: Sep 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The new version of application.run is now: call
E.g.
instead of application.run(remove popup1)
It's not Call remove popup1
|
|

November 2nd, 2007, 01:47 PM
|
|
Authorized User
|
|
Join Date: Sep 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ooops... I wrote "not call remove popup1"
It should've been
now
call remove popup1
|
|

November 2nd, 2007, 09:09 PM
|
|
Registered User
|
|
Join Date: Jul 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Many thanks for your response
Sorry but i am still not getting it. I need to replace for example
application.run ("edate", date, 2)
tried call "edate", date, 2 - not working
worksheetfunction.EDate (date,2) obviously works but i have code writen in Excel 2003 which uses excel date functyions extensively through application.run. Need to know the best way of replacing it.
vivek
|
|

November 2nd, 2007, 10:50 PM
|
|
Authorized User
|
|
Join Date: Sep 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ok, I have to ask... and please be clear/succinct.
you wrote:
"
application.run ("edate", date, 2)
tried call "edate", date, 2 - not working
"
With Call "edate" you do not need to write the two double quotes.
E.g.
try
Call edate
that's it.
nothing else.
|
|

November 3rd, 2007, 04:02 AM
|
|
Registered User
|
|
Join Date: Jul 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks again Steve but,
In Excel2003, I used
application.run("edate", date,2)
If i use the below
Call edate(date,2)
it does not work.
Sorry if i am being dense!
|
|

November 3rd, 2007, 03:58 PM
|
|
Authorized User
|
|
Join Date: Sep 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ah....
You didn't tell me 2003 before.
That I cannot help you with. If you looked more closely at the title of this specific component of the forum, you'd see it was for 2007. I.e., Excel 2007 VBA Programmers Reference.
My troubles have been with 2007.
My understanding of 2003 is that all of the VBA code from Office 97, through 2003 is identical.
Therefore, the application.run should work.
Have you tried the MSDN newsgroups?
http://msdn.microsoft.com/newsgroups...xp=&sloc=en-us
I use them for most of my stuff.
I'd only come here to post because we got the book, and there was a faceid macro I tried. I was having trouble getting the macro to work the way it was written, so I came here to ask why.
Sunday and I got it worked out, and that was the last I posted here--until I got the subscription note that you came in looking for help.
|
|

November 4th, 2007, 12:32 AM
|
|
Registered User
|
|
Join Date: Jul 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry Steve,
I think i have not been clear. What I meant was in Excel 2003, I have always used
application.run("edate", date, 2) and it works.
However in Excel 2007 this does not work. I have tried replacing it by
1)Call "edate", date, 2
and
2)Call edate, date,2
and both do not work.
I will check up the msdn site. Will let you know if it gets sorted.
Thanks ton for ur time mate:)
|
|

November 4th, 2007, 05:09 PM
|
|
Authorized User
|
|
Join Date: Sep 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ok, I see now.
You've used
application.run ("edate", date, 2)
under 2003, and it works fine.
under 2007, the following is required.
Call edate
That's it. nothing else.
Do not add the quotes, do not add the-- date, 2-- or anything else.
What you're doing is calling to activate another macro that's already been defined elsewhere.
The ("edate", date, 2) is actually calling specific items under the "edate" macro. by doing call edate, date, 2, you're redefining, or re-stating what's already been stated/defined under your edate macro. So, somewhere in one of your macro modules, you defined a macro.
You named the macro edate.
is it a private/public function, or is it a Sub macro?
If you're macro is a function, then you will need to define the second, and 3rd elements-- date, 2-- somewhere else, and that I do not know about. I haven't attempted that yet.
|
|

February 12th, 2009, 06:13 AM
|
|
Authorized User
|
|
Join Date: Mar 2008
Posts: 74
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
Watch text carefully!!!
I have read all posts and figured out that lots of people can't read carefully. Lemme explain this.
The authors of the book created these three Subs for displaying controls and their FaceIDs: ListFirstLevelControls, ListAllControls and ListAllFaces.
Also they created Function called IsEmptyWorksheet. As we can figure out from Function's name, it returns Boolean value. Thus, we press F2 (Object Browser), choose "VBA" and select "Information" section. There's no such Function. So, we must assume that this is USER-DEFINED Function. Heh... Where is it? It's located on page 324!
Thus, we create a module and insert into it Sub ListAllFaces and Function IsEmptyWorksheet. All works fine. I got 16208 FaceIDs.
So, here's the question: what for to write one Function three times? The answer: authors created it only ONCE for brevity!!!!!
TIP. If you don't see some function or sub, look thru all chapter - it can be placed somewhere in chapter!!!!!
|
|
 |