Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, May 25, 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 - Legacy Development
Forum to discuss SalesLogix legacy development including views, scripts, etc.. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Legacy Development | New ThreadView:  Search:  
 Author  Thread: Legacy Code intgrating with Excel
Stephen Savage
Posts: 3
 
Legacy Code intgrating with ExcelYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jun 08 8:14 AM
Hi,

I am starting my first custom integration with Excel and i need some help.

I am trying to write so code that will allow the user to select and Excel file which, amongst other values, contains InternalAccountNo.

I want to be able to loop through all the Excel rows and having read this value, perform some check in SLX.

I then want to write some values on to the end to the row in the Excel file.

I have expanded on the basic idea from the example in the dev ref but I am getting a little stuck.

I have access the VB Object Explorer from the Marco editor inside Excel and can see all the Object, Methods, etc but I am having some trouble with certain elements.

All of this work perfectly:

Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Add(strFile) 'This is the .xls file to use
msgbox objExcel.Worksheets(1).Name
objExcel.Worksheets(1).Select 'Select the Worksheet we need to use
objExcel.Visible = True 'Watch Excel work while posting
objExcel.Range("A1").Select

but it does not like:

objExcel.Range(Selection, Selection.End(xlDown)).Select

even if i put in the actual value instead of xlDown

objExcel.Range(Selection, Selection.End(-4121)).Select

I even tried

objExcel.Range(objExcel.Selection, objExcel.Selection.End(xlDown)).Select
objExcel.Range(objExcel.Selection, objExcel.Selection.End(-4121)).Select

Can someone steer me in the right direction as I would like to keep all of this inside SLX if I can, or am I going to have to do all of this in VB and have the user simply launch a custom app?

Thanks in advance
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Legacy Code intgrating with ExcelYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Jun 08 11:43 PM
First of all... Legacy (Cypress Enable) does a very poor job of supporting COM (CreateObject) - especially Excel. Severe memory leaks. The only solution is to upgrade to a version of SalesLogix tha supports VBScripting (ex: 7.2.2).

For your specific problem, I suggest turning on the Excel macro recorder and doing it manually. Then look at what it recorded. That is how most of us do this kind of thing.
--
RJLedger - rjlSystems
"... Customer First..."
[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): 5/25/2024 1:51:00 PM