Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext

RE: Launch EXCEL and show add-in
Gary Roberts 3.Feb.07 09:53 AM a Web browser
Notes Client 6.5.3 Windows 2000


Lisa,

Here's a very simple implementation of the ShellExecute Windows API. NOTE: It will launch ANY program -- not just Excel -- it will determine, from the filename extension, which program to launch and attempt to launch it. It will return True if it is successful or False if it fails. Plug the code into a BUtton in a Notes form to test it and see how it works.

Gary

REM Declarations for Windows API -- ShellExecute
Declare Function ShellExecute Lib _
"shell32.dll" Alias "ShellExecuteA" _
(Byval hwnd As Long, _
Byval lpOperation As String, _
Byval lpFile As String, _
Byval lpParameters As String, _
Byval lpDirectory As String, _
Byval nShowCmd As Long) As Long

Sub Click(Source As Button)
REM This code is in a button for testing -- you could use it virtually anywhere
Dim success As Variant
Const FileToLaunch = "c:\Test.xls" ' VALID File Name for testing -- you will replace it with your object.Name reference
' Const FileToLaunch = "c:\oopsTest.xls" ' INVALID filename for testing treturn values
success = LaunchFile( FileToLaunch )
If Not success Then Msgbox "Error launching " & FileToLaunch
End Sub


Function LaunchFile( FileToLaunch ) As Boolean
REM Implements the ShellExecute Windows API
REM Returns True if successful (File exists and was able to launch the program associated with it)
REM Returns False if failure (File does not exist or was NOT able to launch the program associated with it)
LaunchFile = False
Dim iret As Long
Dim intReturnValue As Integer
Const SW_SHOWNORMAL = 1
iret = ShellExecute( 0, _
"Open", _
FileToLaunch, _
"", _
"c:\", _
SW_SHOWNORMAL )
intReturnValue = Cint( iret ) - 32
If intReturnValue > 0 Then
LaunchFile = True
Else
LaunchFile = False
End If
End Function




Launch EXCEL and show add-in (Lisa B. Washing... 2.Feb.07)
. . RE: Launch EXCEL and show add-in (Gary Roberts 2.Feb.07)
. . . . RE: Launch EXCEL and show add-in (Lisa B. Washing... 2.Feb.07)
. . . . . . RE: Launch EXCEL and show add-in (Gary Roberts 3.Feb.07)
. . . . . . . . RE: Launch EXCEL and show add-in (Lisa B. Washing... 4.Feb.07)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite