Zumasys Homepage
Forum Home Forum Home > AccuTerm > Code Samples
  New Posts New Posts RSS Feed - Sub: load speadsheet from Excel via Objects
  FAQ FAQ  Forum Search   Register Register  Login Login

Sub: load speadsheet from Excel via Objects

 Post Reply Post Reply
Author
Message
SeanC View Drop Down
Newbie
Newbie


Joined: July 06 2021
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote SeanC Quote  Post ReplyReply Direct Link To This Post Topic: Sub: load speadsheet from Excel via Objects
    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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

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