Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call a file via command button ? 1

Status
Not open for further replies.

Recce

Programmer
Aug 28, 2002
425
ZA
Hi, How do I call a file via a command button. I have looked at the Call and Shell functions but that does not seem to work. Any suggetions would be appreciated. :->
 
Recce
What kind of file are you trying to 'call'?

Call passes execution control to a procedure, function or DLL procedure

Shell lauches another application
eg Shell "c:\windows\command.com", vbNormalFocus
launches DOS (path true for win95, dunno about NT etc!)

;-)


If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Hi loomah. Yes your right I used that and it works but, let me tel you the whole story and then maybe you can make some suggestions if possible. I want to create a button on the spread sheet which will call script (Cognos Script).
 
Hi Recce
I think I'll have to bow out on this. My experience of such things is very limited - I know nothing about Cognos!

From what I know I think you'll have problems calling anything that isn't compiled in some way (but that's just in my existing knowledge)

The closest I've come is in calling a batch file
eg
Code:
Private Sub CommandButton1_Click()
Shell "C:\My Documents\Bats\Call_Environs.bat", vbNormalFocus
End Sub

The batch file above, by way of example, is simply:-
echo off
cls
set
pause

Sorry I can't really help any further. If you have no further joy here I'd try the MS excel programmers newsgroup or a Google search next.

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Loomah, but that is a briliant idea. I don't know why I didn't think of that cause that is what I do currently. I execute all my Cognos reports and models and script from Batch files. It's sometimes just that different way of thinking. Thanks vey much. [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top