Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

Run Excel Macro while Closed

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
ctownsen80
Asked:
ctownsen80
  • 2
  • 2
1 Solution
 
CodeCruiserCommented:
I would say No.
0
 
Martin LissOlder than dirtCommented:
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
 
ctownsen80Author Commented:
@MartinLiss -- you mean export data to the sheet via access, instead of trying to import data into the workbook? Or something else?
0
 
Martin LissOlder than dirtCommented:
All I'm saying is that you can get data from a closed workbook and here's an example.
0
 
CodeCruiserCommented:
Is VB.NET involved in this? as its one of the zones. If it is, you can export to Excel using OLEDB driver.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now