Solved

Problem starting Excel template from Access

Posted on 2014-09-24
3
242 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
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…

896 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now