Solved

Problem starting Excel template from Access

Posted on 2014-09-24
3
246 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
  • 2
3 Comments
 
LVL 84

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 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