Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet.activate not activating
as a last command to several routines in a program, I have a line with
worksheets("....").activate; however, the worksheet does not get activated upon termination of the program. Any ideas how to get this to happen? Thanks. Smokii |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet.activate not activating
I never had a such problem myself with this sort of issue. However, as a
general rule of thumb, I avoid using the "Activate" method unless it's really needed, which should really be the exception rather than the norm. I know the macro recorder uses the Activate method, but it's limited to what it can do, and most times, it's only really there to learn how macros are created and ran, which is how I got started working with macros in Excel. However, along the way early on, I ran into several issues (this was when I was using Excel 97, SR2) using the Select and Activate methods (Select on ranges and Activate on worksheets). This also was the same type of reasons why I don't use ActiveWorksheet or ActiveWorkbook so much either. Much of the programming that I did real early on, it involved several worksheets and something like 20 to 25 different workbooks, though not all at one time, but still, enough to where it caused some issues, and not only that, but I also wanted to be able to use the computer for other things while the program was running, which meant I had to eliminate the ActiveWorkbook, ActiveWorksheet, Activate Method, and Select Method all together from my program, as well as any SendKeys statements/functions. As far as that's concerned, there is one such program that I have to use the SendKeys statements for, which by the way, I only trust the Application's SendKeys, not VBA's SendKeys, as there's an issue with the VBA one. Are you using "Applicaiton.ScreenUpdating"? if you are setting this to False for efficiency purposes, reset this to "True" at the end of the code, as this has to be done else you won't get what you need. -- Ronald R. Dodge, Jr. Production Statistician Master MOUS 2000 wrote in message oups.com... as a last command to several routines in a program, I have a line with worksheets("....").activate; however, the worksheet does not get activated upon termination of the program. Any ideas how to get this to happen? Thanks. Smokii |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet.activate not activating
I appreciate your experience and comments. I am in fact unable to use
my computer effectively while my program is running. I am opening up approximately 50 or so files one at a time, processing data on from these files, adding charts and performing various algorithms, and then saving the file as an xls. I use the activeworkbook and activeworksheet throughout the code (errr). anyhow, to answer your question, at the end of my program, I do change screenupdating back to true before I apply worksheet.activate. What is happening is that once my program begins, various worksheets in the program become active, and upon termination, i want to user to start off where he began. if there is another way, i'd be obliged to know it. Thanks. Smokii |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet.activate not activating
Are you sure the correct workbook was active when you tried to activate that
worksheet? (If you're unlucky, then maybe there was a worksheet name that matched and you just got the wrong one activated???) wrote: I appreciate your experience and comments. I am in fact unable to use my computer effectively while my program is running. I am opening up approximately 50 or so files one at a time, processing data on from these files, adding charts and performing various algorithms, and then saving the file as an xls. I use the activeworkbook and activeworksheet throughout the code (errr). anyhow, to answer your question, at the end of my program, I do change screenupdating back to true before I apply worksheet.activate. What is happening is that once my program begins, various worksheets in the program become active, and upon termination, i want to user to start off where he began. if there is another way, i'd be obliged to know it. Thanks. Smokii -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet.activate not activating
i'm sure...i have a single file where i run my program...and it has a
specific sheet name. it worked a few iterations ago, but it suddenly stopped. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Activating a Worksheet? | Excel Discussion (Misc queries) | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
Worksheet activating | Excel Programming | |||
Worksheet activating | Excel Programming | |||
Activate Macro on Activating a sheet | Excel Programming |