Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Excel application object - Avoid any errors
Kevin Austin
Posts: 105
 
Excel application object - Avoid any errorsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Oct 06 5:29 AM
fiogf49gjkf0d
Basically I'm constructing an excel application object but I want it to avoid any error conflicts if excel is not installed on the pc the script will be ran on. I could check to see if the excel executable exists and go about it that way but is there a more reliable way of going about this?
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Excel application object - Avoid any errorsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Oct 06 3:31 AM
fiogf49gjkf0d
You could instantiate the object and specifically trap the 'Excel object not found' (or whatever) error.
[Reply][Quote]
Jay Welther
Posts: 28
 
Re: Excel application object - Avoid any errorsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Oct 06 7:41 AM
fiogf49gjkf0d
To expand on Phil's comment, here is some code I reused from something similar I found in the SLX source:

sub CallExportExcel()
if IsExcelInstalled then
FixCol grdForecast.Columns, True
ExportGridToExcel grdForecast, "Forecast"
FixCol grdForecast.Columns, False
else
Msgbox "Error: Excel is not installed."
end if
end sub

function IsExcelInstalled
dim objExcel

on error resume next
set objExcel = CreateObject("Excel.Application")
If (err.number <> 0) Then
err.clear
IsExcelInstalled = False
Else
IsExcelInstalled = True
End If

set objExcel = Nothing

on error goto 0
end function
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/26/2024 6:32:37 PM