ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 09-29-2010
Ryan Haferbecker's Avatar
Ryan Haferbecker Ryan Haferbecker is offline
Flexsim User
 
Join Date: Mar 2009
Location: Elk River, Mn
Posts: 24
Downloads: 3
Uploads: 0
Thanks: 7
Thanked 9 Times in 4 Posts
Rep Power: 142
Ryan Haferbecker is on a distinguished road
Default Communicating with Excel

Having some issues communicating with Excel. I am currently using version 4.5_2 and am having problems with some very basic Excel write out function. Also am using a 64 bit workstation (Windows XP). I made a super simple model to start experimenting with using Excel spreadsheet and have written the following code to execute in on Entry trigger to a processor.

excellaunch("C:/Program Files (x86)/Microsoft Office/Office12");
excelopen("N:/Flexsim/P10/Boeing/1442 Work Flow/Flextest.xlsx");
excelsetsheet("Sheet1");
excelwritenum(1,1,69);
excelclose(1);
excelquit();

What happens is a GUI saying "An exception occured." and a path to a .txt file for details. The file says the following:

The object invoked has disconnected from its clients.

ExcelSetSheet: SheetName: _Sheet1_
----------------------------
----------------------------

ExcelWriteNum Row:1 Col:A Value:69.000000
----------------------------


Not sure what I am doing wrong or what the problem might be? Thanks for your assistance.

Ryan Haferbecker
  #2  
Old 09-29-2010
Ryan Haferbecker's Avatar
Ryan Haferbecker Ryan Haferbecker is offline
Flexsim User
 
Join Date: Mar 2009
Location: Elk River, Mn
Posts: 24
Downloads: 3
Uploads: 0
Thanks: 7
Thanked 9 Times in 4 Posts
Rep Power: 142
Ryan Haferbecker is on a distinguished road
Default

Turns out I didn't not properly close the spreadsheet the first time and added the correct command after I had already corrupted the connection. It works fine after rebooting...All apologies

Ryan
The Following 2 Users Say Thank You to Ryan Haferbecker For This Useful Post:
Phil BoBo (09-29-2010)


Thread Thread Starter Forum Replies Last Post
statistics cannot export to excel or csv zhang xin Container Terminal (CT) Library 2 03-12-2010 08:01 AM
Excel Short Cut Keys Brandon Peterson Tips and Tricks 1 09-30-2009 08:04 AM
Excel File Importing John Kim Container Terminal (CT) Library 0 08-06-2009 03:21 PM
Excel 2002 vs. Excel 2007 Nico Zahn Q&A 2 04-27-2009 01:47 AM
Excel and global tables Bill Nordgren Q&A 2 10-15-2007 04:36 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.