Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default how to add a sub at the application level open event?

Greetings,

How do I add a subroutine at the application level?

Example: When I start up Excel I want to have it bring up a messagebox that
says "test"

I can see in the VB editor how to do this at the workbook level in the
workbook open event. But I need to do this at the application level.

Thanks.
Rich
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default how to add a sub at the application level open event?

Have a look at Chip's page regarding Application Level Events.
http://www.cpearson.com/excel/AppEvent.aspx

Rich wrote:
Greetings,

How do I add a subroutine at the application level?

Example: When I start up Excel I want to have it bring up a messagebox that
says "test"

I can see in the VB editor how to do this at the workbook level in the
workbook open event. But I need to do this at the application level.

Thanks.
Rich


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default how to add a sub at the application level open event?

Put the workbook open macro in your personal.xls file.
--
Gary''s Student - gsnu200751


"Rich" wrote:

Greetings,

How do I add a subroutine at the application level?

Example: When I start up Excel I want to have it bring up a messagebox that
says "test"

I can see in the VB editor how to do this at the workbook level in the
workbook open event. But I need to do this at the application level.

Thanks.
Rich

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default how to add a sub at the application level open event?

Already went there. The last time I needed to do something like this was in
Excel 97 and I believe they had an Application level in the Project browser
and then the ThisWorkbook selection for respective workbooks. I have done
this before, but years ago.

If I add code to thisworkbook, won't that only run when I open Thisworkbook?
In need to invoke a sub right when Excel Starts, kind of like the AutoExec
macro or OnStartup in an Access mdb.

May I ask if you could show me a sample, maybe I need to use an xla or
something? A sample of where I would place a simple sub like

Sub TestOpen()
msgbox "test"
End Sub

so that as soon as I click on my Excel icon as excel opens up I get the
"Test" message?

Thanks.

"JW" wrote:

Have a look at Chip's page regarding Application Level Events.
http://www.cpearson.com/excel/AppEvent.aspx

Rich wrote:
Greetings,

How do I add a subroutine at the application level?

Example: When I start up Excel I want to have it bring up a messagebox that
says "test"

I can see in the VB editor how to do this at the workbook level in the
workbook open event. But I need to do this at the application level.

Thanks.
Rich



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default how to add a sub at the application level open event?

Thanks for that suggestion. So I record an Open workbook macro and then
copy that code to personal.xls?

Wait. I think it is starting to come back to me. In the XLstart folder -
do I put something in there?

What is the personal xls file?

Thanks.

"Gary''s Student" wrote:

Put the workbook open macro in your personal.xls file.
--
Gary''s Student - gsnu200751


"Rich" wrote:

Greetings,

How do I add a subroutine at the application level?

Example: When I start up Excel I want to have it bring up a messagebox that
says "test"

I can see in the VB editor how to do this at the workbook level in the
workbook open event. But I need to do this at the application level.

Thanks.
Rich



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default how to add a sub at the application level open event?

I figured out your suggestion. I created a new workbook and called it
Personal.xls and saved it to prog...XLstart and added

msgbox "testing"

to the ThisWorkbook.Open event.

Seems to work OK.

Now the real deal is that Excel is being opened by Sql Server Reporting
services. I have set some Reporting Services reports to open as Excel files
from a .Net app I wrote. The problem is that when users print out the Excel
reports -- they are printing out in landscape but need to be in Portrait
layout. I could add a macro button that the users can press before they
print, but I would rather identify the workbook as a reporting services
workbook and set the page layout to portrait seamlessly. I hope I can
identify the workbook on the application startup.


"Gary''s Student" wrote:

Put the workbook open macro in your personal.xls file.
--
Gary''s Student - gsnu200751


"Rich" wrote:

Greetings,

How do I add a subroutine at the application level?

Example: When I start up Excel I want to have it bring up a messagebox that
says "test"

I can see in the VB editor how to do this at the workbook level in the
workbook open event. But I need to do this at the application level.

Thanks.
Rich

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
Application level event help John Bundy Excel Discussion (Misc queries) 2 January 15th 08 10:30 PM
Application level VBE [email protected] Excel Programming 1 December 13th 06 04:17 PM
Application Level macros modjoe23[_3_] Excel Programming 7 August 24th 05 03:14 PM
Application level event handler broken in 2003SP1 ? Alex T Excel Programming 3 August 29th 04 07:47 PM
Monitoring application-level event problem R Avery Excel Programming 2 January 6th 04 01:58 PM


All times are GMT +1. The time now is 06:49 AM.

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

About Us

"It's about Microsoft Excel"