Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Run a Macro over a Closed Workbook??

I have a Macro that copies data to another Workbook. Is it possible to
execute this code without having to actually open up the second Workbook??

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Run a Macro over a Closed Workbook??

John,
If you use ADO (and what you want to do is suitable for this), the workbook
is not opened in the same sense as Excel automation.

NickHK

"John" wrote in message
...
I have a Macro that copies data to another Workbook. Is it possible to
execute this code without having to actually open up the second Workbook??

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Run a Macro over a Closed Workbook??

Thanks for the reply Nick but I'm not sure what ADO is, I've looked it up
under Functions but can't seem to find it


"Nick Cranham" wrote in message
...
John,
If you use ADO (and what you want to do is suitable for this), the

workbook
is not opened in the same sense as Excel automation.

NickHK

"John" wrote in message
...
I have a Macro that copies data to another Workbook. Is it possible to
execute this code without having to actually open up the second

Workbook??

Thanks






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Run a Macro over a Closed Workbook??

John,
Active Data Objects. A way of connecting to data sources, databases, text
files, etc and Excel and performing SQL queries. You can't do any formatting
etc to the workbook, but you can update and retrieve data.

NickHK

"John" wrote in message
...
Thanks for the reply Nick but I'm not sure what ADO is, I've looked it up
under Functions but can't seem to find it


"Nick Cranham" wrote in message
...
John,
If you use ADO (and what you want to do is suitable for this), the

workbook
is not opened in the same sense as Excel automation.

NickHK

"John" wrote in message
...
I have a Macro that copies data to another Workbook. Is it possible to
execute this code without having to actually open up the second

Workbook??

Thanks








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Run a Macro over a Closed Workbook??

John,

Be aware that this is not trivial, will take a degree of learning re ADO,
good workbook design, and a fair amount of code.

IMO it would be simpler just to open the workbook, do your stuff, and close
it. Pragmatism v knowledge, the choice is yours.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"John" wrote in message
...
Thanks for the reply Nick but I'm not sure what ADO is, I've looked it up
under Functions but can't seem to find it


"Nick Cranham" wrote in message
...
John,
If you use ADO (and what you want to do is suitable for this), the

workbook
is not opened in the same sense as Excel automation.

NickHK

"John" wrote in message
...
I have a Macro that copies data to another Workbook. Is it possible to
execute this code without having to actually open up the second

Workbook??

Thanks










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Run a Macro over a Closed Workbook??

John,
That's sound advice from Bob, (I'm not even recommending it) but if you
really do not want to open the workbook for some reason, that's about the
only route to go.

Nick

"Bob Phillips" wrote in message
...
John,

Be aware that this is not trivial, will take a degree of learning re ADO,
good workbook design, and a fair amount of code.

IMO it would be simpler just to open the workbook, do your stuff, and

close
it. Pragmatism v knowledge, the choice is yours.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"John" wrote in message
...
Thanks for the reply Nick but I'm not sure what ADO is, I've looked it

up
under Functions but can't seem to find it


"Nick Cranham" wrote in message
...
John,
If you use ADO (and what you want to do is suitable for this), the

workbook
is not opened in the same sense as Excel automation.

NickHK

"John" wrote in message
...
I have a Macro that copies data to another Workbook. Is it possible

to
execute this code without having to actually open up the second

Workbook??

Thanks










  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run a Macro over a Closed Workbook??

Depends on what you want to do. If you want to retrieve some values from a
sheet in a closed workbook, you could always have your code put a linking
formula in the appropriate cells, then replace the formulas with the
displayed values. This is generally the fastest method as well.

--
Regards,
Tom Ogilvy


"Nick Cranham" wrote in message
...
John,
That's sound advice from Bob, (I'm not even recommending it) but if you
really do not want to open the workbook for some reason, that's about the
only route to go.

Nick

"Bob Phillips" wrote in message
...
John,

Be aware that this is not trivial, will take a degree of learning re

ADO,
good workbook design, and a fair amount of code.

IMO it would be simpler just to open the workbook, do your stuff, and

close
it. Pragmatism v knowledge, the choice is yours.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"John" wrote in message
...
Thanks for the reply Nick but I'm not sure what ADO is, I've looked it

up
under Functions but can't seem to find it


"Nick Cranham" wrote in message
...
John,
If you use ADO (and what you want to do is suitable for this), the
workbook
is not opened in the same sense as Excel automation.

NickHK

"John" wrote in message
...
I have a Macro that copies data to another Workbook. Is it

possible
to
execute this code without having to actually open up the second
Workbook??

Thanks












  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Run a Macro over a Closed Workbook??

I think pragmatism will win out on this occasion Bob.

Thanks


"Bob Phillips" wrote in message
...
John,

Be aware that this is not trivial, will take a degree of learning re ADO,
good workbook design, and a fair amount of code.

IMO it would be simpler just to open the workbook, do your stuff, and

close
it. Pragmatism v knowledge, the choice is yours.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"John" wrote in message
...
Thanks for the reply Nick but I'm not sure what ADO is, I've looked it

up
under Functions but can't seem to find it


"Nick Cranham" wrote in message
...
John,
If you use ADO (and what you want to do is suitable for this), the

workbook
is not opened in the same sense as Excel automation.

NickHK

"John" wrote in message
...
I have a Macro that copies data to another Workbook. Is it possible

to
execute this code without having to actually open up the second

Workbook??

Thanks










  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Run a Macro over a Closed Workbook??

Understandable<G

Bob

"John" wrote in message
...
I think pragmatism will win out on this occasion Bob.

Thanks


"Bob Phillips" wrote in message
...
John,

Be aware that this is not trivial, will take a degree of learning re

ADO,
good workbook design, and a fair amount of code.

IMO it would be simpler just to open the workbook, do your stuff, and

close
it. Pragmatism v knowledge, the choice is yours.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
closed workbook macro puiuluipui Excel Discussion (Misc queries) 1 July 4th 08 10:13 PM
Create Move Macro for Closed Workbook Roger Excel Discussion (Misc queries) 3 January 15th 08 02:19 AM
Value from a closed workbook Anthony Slater Excel Discussion (Misc queries) 5 May 17th 05 09:49 AM
copy worksheet from closed workbook to active workbook using vba mango Excel Worksheet Functions 6 December 9th 04 07:55 AM
how to run macro of closed excel workbook using VBA santoshkumar Excel Programming 3 November 10th 03 02:23 PM


All times are GMT +1. The time now is 03:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright Š2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"