Solved

Using CREATEOBJECT() with Excel Starter

Posted on 2014-09-19
4
571 Views
Last Modified: 2014-09-21
I've got an application that normally outputs its reports to Excel.

It opens an instance of Excel by means of the function CREATEOBJECT("Excel.Application").

I have one user for whom this doesn't work - the function does not open an instance of Excel.

The system on which they are running the software does not have a full copy of Excel; instead it has a copy of Excel Starter.

Do I need to do something different with my CREATEOBJECT() function call - or is Excel Starter such a cut-down version of the product that what I am trying to do is impossible?
0
Comment
Question by:IainMacb
  • 2
  • 2
4 Comments
 
LVL 41

Accepted Solution

by:
pcelba earned 500 total points
ID: 40334542
Office starter version does not support OLE Automation so you cannot use CREATEOBJECT("Excel.Application").

The only solution is to install full desktop Excel version.

Also Office 365 running in a cloud does not allow automation from FoxPro. You have to install Office 2013 on your desktop instead. Fortunately, Office 2013 is included in some editions of Office 365.
0
 
LVL 1

Author Closing Comment

by:IainMacb
ID: 40334605
Well, that would explain what's going on! And thanks for the warning about Office 365.

Meanwhile, I do wish it was possible to find this out from M*cr*s*ft's own 'help' pages.
0
 
LVL 1

Author Comment

by:IainMacb
ID: 40335163
A further thought. Presumably I could try opening a copy of Excel at the start of my program and record whether this had worked into a global memory variable. Then close this copy, using .QUIT.

That way I could use the global memory variable to disable the output-to-Excel buttons that I have in my software.
0
 
LVL 41

Expert Comment

by:pcelba
ID: 40335536
Yes, this is possible. You just have to enclose the CREATEOBJECT() into TRY CATCH block to avoid possible error messages.

Another question is if this is necessary to do at the app start. You may do it later when user opens the form having Excel buttons implemented.

I would even say the always enabled button which tests the Excel object accessibility on each click is also good option because it does not consume resources at app start.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
Viewers will learn how to find and create templates in Excel 2013.
Viewers will learn the basics of formula auditing in Excel 2013.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question