Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Parameters to VB function
Message
From
16/11/1999 14:21:30
 
 
To
16/11/1999 13:26:17
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00291539
Message ID:
00291569
Views:
26
>Once you have the object reference, you should be able to everything you need from within VFP. What are you trying to do?

That's my problem. I don't have the object reference!! I'm trying to pass parameters to a macro or something that will get the job done. If you want the whole sob story, it's basically this:
I have a VFP app that can't use the .fileopen(xx,yy,zz) command from ms project because it's forcing me to enter a parameter that makes the whole thing blow up - this is because it has to use sequential parameters as opposed to named parameters. I can pass it xx just fine, but I really need to pass it zz, but once I enter yy it explodes. If I'm in the VB/VBA environment I can use named parameters on the fileopen command, but somehow I have to get into that environment. I can open the file from a macro no problem, but I need to pass it the file name and some other stuff from Fox. Therefore, I guess my question is truely, what is the object reference for macros/subroutines/functions inside an application? I've tried:

xapp=createobject("msproject.application")
xapp.visible=.t.
xapp.macroname(xx,zz)
xapp.activeproject.macroname(xx,zz)
xapp.thisproject.macroname(xx,zz)
xapp.application.macroname(xx,zz)
These all give me objectname unknown type error messages
the only thing that I have found that works is xapp.macro("Macroname"), as long as the macro looks like this:
sub macroname()
' blah blah
endsub

if it looks like this:
sub macroname(xx as string, zz as boolean)
'blah
endsub
it tells me that it can't find macroname().

I figure someone has to have done some variation of this at some point with excel, word, or something, since transferring parameters to a macro is not exclusive to ms project.

Laurisa
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform