PC Review


Reply
Thread Tools Rate Thread

How do Excel define the application area?

 
 
Eric
Guest
Posts: n/a
 
      9th Apr 2010
When I run a macro as shown below, how does excel define the application
area?

Disable re-calculation option before processing coding
After processing coding, enable re-calculation option

calcmode = application.calculation
application.calculation = xlCalculationManual
'open worksheet2.xls by using worksheet1's macro
application.calculation = calcmode

Case 1
If I open an excel worksheet1.xls, then I open worksheet2.xls within this
open worksheet1, do I open 1 excel application? If I set calcmode, will it
apply to both worksheets at this moment?

Case 2
If I open an excel worksheet1.xls, then I open another excel application and
open worksheet2.xls, do I open 2 excel application? If I set calcmode for
worksheet2, will it apply to worksheet1.xls at this moment?

Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      9th Apr 2010
The excel application is the instance of excel that's running.

And the calculation setting in excel is application-wide. It affects all the
workbooks that are open in that session/instance. (That's #1, right.)

As for number 2, you can start another instance of excel. I don't like to do
this. It makes sharing information (like formulas) difficult between two
workbooks open in different instances.

But when I need to have two instances open, then I open one any way I want and
then I use:
Windows start button
Run
Excel
and hit enter
(flying windows button-r is a quick way to get to that run dialog)

Now I have two instances of excel running and each doesn't know about what's
happening in the other.

=========
But if you're running a macro that changes the calculation mode, does some work
and changes it back, there's not much reason to use two instances.

Calculation is manual for a small (usually) amount of time and while the macro
is running, there's not much you're going to do anyway.





Eric wrote:
>
> When I run a macro as shown below, how does excel define the application
> area?
>
> Disable re-calculation option before processing coding
> After processing coding, enable re-calculation option
>
> calcmode = application.calculation
> application.calculation = xlCalculationManual
> 'open worksheet2.xls by using worksheet1's macro
> application.calculation = calcmode
>
> Case 1
> If I open an excel worksheet1.xls, then I open worksheet2.xls within this
> open worksheet1, do I open 1 excel application? If I set calcmode, will it
> apply to both worksheets at this moment?
>
> Case 2
> If I open an excel worksheet1.xls, then I open another excel application and
> open worksheet2.xls, do I open 2 excel application? If I set calcmode for
> worksheet2, will it apply to worksheet1.xls at this moment?
>
> Does anyone have any suggestions?
> Thanks in advance for any suggestions
> Eric


--

Dave Peterson
 
Reply With Quote
 
Eric
Guest
Posts: n/a
 
      9th Apr 2010
I would like to know when I run a macro to open a worksheet by following codes,
does excel perform updatelinks function first, before perform re-calculate
function?
or do both functions perform simultaneously?
Do you have any suggestions?
Thank you very much for any suggestions
Eric

Set wkbk = Workbooks.Open(Filename:=WkbkName, UpdateLinks:=3)


"Dave Peterson" wrote:

> The excel application is the instance of excel that's running.
>
> And the calculation setting in excel is application-wide. It affects all the
> workbooks that are open in that session/instance. (That's #1, right.)
>
> As for number 2, you can start another instance of excel. I don't like to do
> this. It makes sharing information (like formulas) difficult between two
> workbooks open in different instances.
>
> But when I need to have two instances open, then I open one any way I want and
> then I use:
> Windows start button
> Run
> Excel
> and hit enter
> (flying windows button-r is a quick way to get to that run dialog)
>
> Now I have two instances of excel running and each doesn't know about what's
> happening in the other.
>
> =========
> But if you're running a macro that changes the calculation mode, does some work
> and changes it back, there's not much reason to use two instances.
>
> Calculation is manual for a small (usually) amount of time and while the macro
> is running, there's not much you're going to do anyway.
>
>
>
>
>
> Eric wrote:
> >
> > When I run a macro as shown below, how does excel define the application
> > area?
> >
> > Disable re-calculation option before processing coding
> > After processing coding, enable re-calculation option
> >
> > calcmode = application.calculation
> > application.calculation = xlCalculationManual
> > 'open worksheet2.xls by using worksheet1's macro
> > application.calculation = calcmode
> >
> > Case 1
> > If I open an excel worksheet1.xls, then I open worksheet2.xls within this
> > open worksheet1, do I open 1 excel application? If I set calcmode, will it
> > apply to both worksheets at this moment?
> >
> > Case 2
> > If I open an excel worksheet1.xls, then I open another excel application and
> > open worksheet2.xls, do I open 2 excel application? If I set calcmode for
> > worksheet2, will it apply to worksheet1.xls at this moment?
> >
> > Does anyone have any suggestions?
> > Thanks in advance for any suggestions
> > Eric

>
> --
>
> Dave Peterson
> .
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      9th Apr 2010
I'd suggest that you do some testing.

Add a function that's based on time to a worksheet (and maybe has a line with
Stop on it) to the workbook that's opening.

Then change some values in the workbooks that it uses as links.

Then back to the workbook with the code and see what happens.

Eric wrote:
>
> I would like to know when I run a macro to open a worksheet by following codes,
> does excel perform updatelinks function first, before perform re-calculate
> function?
> or do both functions perform simultaneously?
> Do you have any suggestions?
> Thank you very much for any suggestions
> Eric
>
> Set wkbk = Workbooks.Open(Filename:=WkbkName, UpdateLinks:=3)
>
> "Dave Peterson" wrote:
>
> > The excel application is the instance of excel that's running.
> >
> > And the calculation setting in excel is application-wide. It affects all the
> > workbooks that are open in that session/instance. (That's #1, right.)
> >
> > As for number 2, you can start another instance of excel. I don't like to do
> > this. It makes sharing information (like formulas) difficult between two
> > workbooks open in different instances.
> >
> > But when I need to have two instances open, then I open one any way I want and
> > then I use:
> > Windows start button
> > Run
> > Excel
> > and hit enter
> > (flying windows button-r is a quick way to get to that run dialog)
> >
> > Now I have two instances of excel running and each doesn't know about what's
> > happening in the other.
> >
> > =========
> > But if you're running a macro that changes the calculation mode, does some work
> > and changes it back, there's not much reason to use two instances.
> >
> > Calculation is manual for a small (usually) amount of time and while the macro
> > is running, there's not much you're going to do anyway.
> >
> >
> >
> >
> >
> > Eric wrote:
> > >
> > > When I run a macro as shown below, how does excel define the application
> > > area?
> > >
> > > Disable re-calculation option before processing coding
> > > After processing coding, enable re-calculation option
> > >
> > > calcmode = application.calculation
> > > application.calculation = xlCalculationManual
> > > 'open worksheet2.xls by using worksheet1's macro
> > > application.calculation = calcmode
> > >
> > > Case 1
> > > If I open an excel worksheet1.xls, then I open worksheet2.xls within this
> > > open worksheet1, do I open 1 excel application? If I set calcmode, will it
> > > apply to both worksheets at this moment?
> > >
> > > Case 2
> > > If I open an excel worksheet1.xls, then I open another excel application and
> > > open worksheet2.xls, do I open 2 excel application? If I set calcmode for
> > > worksheet2, will it apply to worksheet1.xls at this moment?
> > >
> > > Does anyone have any suggestions?
> > > Thanks in advance for any suggestions
> > > Eric

> >
> > --
> >
> > Dave Peterson
> > .
> >


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Define Print Area using Variables wfgfreedom@gmail.com Microsoft Excel Programming 2 26th Jan 2008 04:32 AM
Excel.Application User-define Error Michael Kintner Microsoft Access 8 25th Jul 2007 03:35 PM
Excel.Application User-define Error Michael Kintner Microsoft Access Form Coding 8 25th Jul 2007 03:35 PM
how i define the printable area? =?Utf-8?B?YmF0ZXM=?= Microsoft Word New Users 2 22nd Jan 2006 10:47 AM
Macro to define a print area =?Utf-8?B?SlJvYmVydHM=?= Microsoft Excel Misc 8 29th Dec 2003 03:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:59 AM.