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
Printed Date: December 03 2023 at 1:42pm
Software Version: Web Wiz Forums 12.03 -

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/" rel="nofollow - uploads/1657/

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 -
Copyright ©2001-2019 Web Wiz Ltd. -