Solved

Problem starting Excel template from Access

Posted on 2014-09-24
3
252 Views
Last Modified: 2014-09-25
Hi

I have created an Excel (2013) template with quite a bit of VBA code inside, and it works perfectly.

When I start the template with a double click, it creates a new Excel file (of type .xlsm) as expected. So far, so good.

Now I want to start the Excel template from a "switchboard" Access (2013) app, which doesn't sound hard, as I already start loads of other apps (not only Access) with that switchboard app. In the latter I tried using the 2 methods which I already use for all other apps / files:
- either VBA's Hyperlink (first define the link as <path and name of the Excel.xltm file> and then Hyperlink.Follow)
- or the Shell function like this n = Shell(<Excel.exe path and name> """<path and name of the Excel.xltm file>"""

However, when I use either of these 2 methods, the Excel template ITSELF opens, it does NOT create a new Excel file. What shall I do or modify in the above to have the Excel template to create a new Excel file ?

Thanks for help
Bernard
0
Comment
Question by:bthouin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40341934
I believe you have to use Automation to handle this, something like:

Dim xl As Object
Set xl = CreateObject("Excel.Application")
Dim wb As Object
Set wb = xl.Workbooks.Add(Template:="Path to your template"
0
 
LVL 1

Author Comment

by:bthouin
ID: 40343478
Hi Scott

This starts Excel (I can see it appearing in the Task Manager), but Excel is not visible, so something is missing.
0
 
LVL 1

Author Comment

by:bthouin
ID: 40343509
Sorry, found it: make Excel app visible...

Thanks Scott, you get the points.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

688 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