Print Page | Close Window

Sub: load speadsheet from Excel via Objects

Printed From: Rocket Software
Category: AccuTerm Knowledge Base (read only)
Forum Name: Code Samples
Forum Description: Share your code samples and discuss the bundled sample programs
URL: https://forum.asent.com/forum_posts.asp?TID=2762
Printed Date: December 07 2022 at 9:02pm
Software Version: Web Wiz Forums 12.03 - http://www.webwizforums.com


Topic: Sub: load speadsheet from Excel via Objects
Posted By: SeanC
Subject: Sub: load speadsheet from Excel via Objects
Date Posted: July 11 2022 at 6:36pm
I needed a way to drop a spreadsheet into an Accuterm and made this subroutine to handle that. This is a hello world program for application object mode so I'd appreciate feedback about improvements.

This subroutine opens the Excel application; loads the spreadsheet without showing it on screen; selects the whole spreadsheet; copies it to the clipboard; pastes the clipboard into the passed AT grid.
Limitations: The AT program really needs to wait until the copy is complete, but I couldn't find an object event I could use to insure that. I'm using RELEASEOBJECT for the Range and Worksheet objects to get close without un-needed delays along with a short SLEEP .1 delay as a hack that's working. If someone with Object Manager experience has a better way I'd love to hear it.

Comments in the bottom have a link to Microsoft documentation for the object methods and properties, as well as the object syntax for some sample calls

uploads/1657/AT.EXCELOPENCOPY.txt.zip" rel="nofollow - uploads/1657/AT.EXCELOPENCOPY.txt.zip



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 - http://www.webwizforums.com
Copyright ©2001-2019 Web Wiz Ltd. - https://www.webwiz.net