Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Excel Automation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arshavir Grigorian - 08 Feb 2008 22:46 GMT
Hi,

I am wondering if there is a way to develop a batch process that could
open a series of spreadsheets (optional really cause no one needs to
look at them), execute a certain macro (or several) in each one, then
print a certain sheet (or several) from each spreadsheet.

Thanks.
Jim Rech - 09 Feb 2008 15:14 GMT
>> I am wondering if there is a way to develop a batch process that

That's what automation is about.  You might search on "excel automation".
I'm sure you'll get hits.

Signature

Jim

> Hi,
>
[quoted text clipped - 4 lines]
>
> Thanks.
ilia - 09 Feb 2008 18:21 GMT
The batch process as you call it is itself a macro.  You will need to
define rules of which workbooks are to be opened, which information is
to be pulled from them (I'm guessing this is the "certain macro"
you're referring to), and which sheets from them will need to be
printed.  Once you have those figured out, you can translate these
rules into VBA code that will automate the process.

> Hi,
>
[quoted text clipped - 4 lines]
>
> Thanks.
Arshavir Grigorian - 11 Feb 2008 23:50 GMT
> The batch process as you call it is itself a macro.  You will need to
> define rules of which workbooks are to be opened, which information is
> to be pulled from them (I'm guessing this is the "certain macro"
> you're referring to), and which sheets from them will need to be
> printed.  Once you have those figured out, you can translate these
> rules into VBA code that will automate the process.

Thanks. But this would still require some human intervention to open
Excel and run the macro. Ideally, I am looking to develop a process
that can be run at certain date/time as a scheduled task.
Gord Dibben - 12 Feb 2008 00:16 GMT
Windows Task Scheduler to open Excel and run the workbook_open event code?

Gord Dibben  MS Excel MVP

>Thanks. But this would still require some human intervention to open
>Excel and run the macro. Ideally, I am looking to develop a process
>that can be run at certain date/time as a scheduled task.
Arshavir Grigorian - 12 Feb 2008 20:14 GMT
What if someone wants to open the spreadsheet for viewing without
running the VB code?

> Windows Task Scheduler to openExceland run the workbook_open event code?
>
[quoted text clipped - 8 lines]
>
> - Show quoted text -
Gord Dibben - 12 Feb 2008 20:54 GMT
Open in safe mode or hold SHIFT key while opening.

Or............

Set security to medium and disable macros when asked.

Gord

>What if someone wants to open the spreadsheet for viewing without
>running the VB code?
[quoted text clipped - 11 lines]
>>
>> - Show quoted text -
Arshavir Grigorian - 12 Feb 2008 22:16 GMT
Well, that means I need to force all users to do something extra just
to open a spreadsheet. And if someone doesn't remember to do so, then
they will be executing things without knowing about it. Not very
intuitive. It would work much better, if the functionality were there
and a user could use it if s/he chose to (vs the other way around). By
the same token, I (as the developer) should be able to create a
process and explicitely execute a macro and maybe even specify an
input parameter to the macro code (e.g. if my spreadsheet queries a
database and I need to specify a parameter in the WHERE clause).

Can that be done?

> Open in safe mode or hold SHIFT key while opening.
>
[quoted text clipped - 24 lines]
>
> - Show quoted text -
Gord Dibben - 13 Feb 2008 01:02 GMT
I thought your original problem was how to open Excel and run a macro.

>> >> >Thanks. But this would still require some human intervention to open
>> >> >Excel and run the macro. Ideally, I am looking to develop a process
>> >> >that can be run at certain date/time as a scheduled task.- Hide quoted text -

I made a suggestion to use Windows Task Scheduler.

Now you are wondering how users can open that workbook without macros enabled.

I would now suggest you purchase a digital certificate and sign your workbook.

Gord

>Well, that means I need to force all users to do something extra just
>to open a spreadsheet. And if someone doesn't remember to do so, then
[quoted text clipped - 36 lines]
>>
>> - Show quoted text -
Arshavir Grigorian - 13 Feb 2008 01:58 GMT
My objective is to ultimately develop a flexible application. And the
two scenarios are not mutually exclusive - running the code in a batch
process AND opening the spreadsheet manually to make changes or learn
how it works or simply to view the data electronically or whatever
else.

To be sure, I am not worried about users intentionally altering/
breaking the code, but rather executing code without knowing about it
which is what workbook_open event would do every time someone opens
the file. So I don't think digitally signing the workbook is relevant.

> I thought your original problem was how to open Excel and run a macro.
>
[quoted text clipped - 55 lines]
>
> - Show quoted text -
Diver Mike - 01 Mar 2008 21:35 GMT
I think you could create a form to be displayed upon open that would give the
user options to continue execution of the desired code or to open the
workbook for "viewing purposes".  If needed you could even add a simple
password to prevent folks who are not supposed to execute the code from doing
so.  Just an idea.

> My objective is to ultimately develop a flexible application. And the
> two scenarios are not mutually exclusive - running the code in a batch
[quoted text clipped - 64 lines]
> >
> > - Show quoted text -
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.