Solved

Run Excel Macro while Closed

Posted on 2013-05-16
5
256 Views
Last Modified: 2014-02-24
I have an excel file (.xlsm) located at "C:\My Documents".  Within this file, there is a macro called "RefreshData" that goes out to a server and pulls in data.  Not sure if its relevant, but the server is called "Server123" and the table is pulls in is called "TableData5". I would like to know is it possible to run this macro without actually opening the file. I would like to be able to click a button in MC Access...lets called the database "AccessDB.accdb" and its also located in "C:\My Documents"... , and excecute the process to make this happen.

Is this possible? If it is, can you please create a VB script to insert into an MS Access module to run?

Also, please don't send me a link to a similar question :) Appreciated, but sort of in a time crunch to figure this out. Direct input is much appreciated :D

Thanks!
0
Comment
Question by:ctownsen80
  • 2
  • 2
5 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
I would say No.
0
 
LVL 45

Accepted Solution

by:
Martin Liss earned 500 total points
Comment Utility
It's not possible to run code that's in a closed workbook, but why can't you make a copy of that code and execute it from Access VBA?
0
 

Author Comment

by:ctownsen80
Comment Utility
@MartinLiss -- you mean export data to the sheet via access, instead of trying to import data into the workbook? Or something else?
0
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
All I'm saying is that you can get data from a closed workbook and here's an example.
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Is VB.NET involved in this? as its one of the zones. If it is, you can export to Excel using OLEDB driver.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

15 Experts available now in Live!

Get 1:1 Help Now