?
Solved

Run Excel Macro while Closed

Posted on 2013-05-16
5
Medium Priority
?
266 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
[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
  • 2
5 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39171554
I would say No.
0
 
LVL 49

Accepted Solution

by:
Martin Liss earned 1500 total points
ID: 39171597
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
ID: 39171744
@MartinLiss -- you mean export data to the sheet via access, instead of trying to import data into the workbook? Or something else?
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 39171819
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
ID: 39174343
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

762 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