A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

error issue



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 10th 08, 04:47 PM posted to microsoft.public.outlook.program_vba
JT
external usenet poster
 
Posts: 41
Default error issue

I'm running an Excel macro from an Outlook module. I can automate this
process when a reminder kicks off. The macro has been working until this
week.

This is my variable: Public xlApp As Excel.Application

I create a new Excel application at the beginning of the macro:

Set xlApp = New Excel.Application
xlApp.Visible = True
xlApp.Workbooks.Add

I then do some stuff and I now want to select the data and sort it

The next line works and the appropriate data is selected

xlApp.Range("A2:Y2").Select

However, when the next line is run, it kicks me out of the Outlook module

xlApp.Range(Selection, Selection.End(xlDown)).Select

Any ideas why this is happening? It had been working fine for several weeks
but now it won't finish. Any suggestions would be appreciated. Thanks for
the help...
--
JT
Ads
  #2  
Old September 10th 08, 07:16 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default error issue

Sounds like you're hitting an unhandled error (and will probably want to add
error handling as a general principle). Selection by itself wouldn't mean
anything to Outlook code, but xlApp.Selection would be the cells that are
selected in the Excel application.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54




"JT" wrote:

I'm running an Excel macro from an Outlook module. I can automate this
process when a reminder kicks off. The macro has been working until this
week.

This is my variable: Public xlApp As Excel.Application

I create a new Excel application at the beginning of the macro:

Set xlApp = New Excel.Application
xlApp.Visible = True
xlApp.Workbooks.Add

I then do some stuff and I now want to select the data and sort it

The next line works and the appropriate data is selected

xlApp.Range("A2:Y2").Select

However, when the next line is run, it kicks me out of the Outlook module

xlApp.Range(Selection, Selection.End(xlDown)).Select

Any ideas why this is happening? It had been working fine for several weeks
but now it won't finish. Any suggestions would be appreciated. Thanks for
the help...
--
JT

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 issue on Windows Vista - Exchange connection issue NA[_2_] Outlook - Installation 5 September 3rd 08 08:28 AM
.xnk issue questiongirl Outlook - General Queries 3 August 5th 07 04:57 PM
Issue with IE7 Mohammad Outlook Express 2 April 11th 07 10:40 AM
Another DST Issue The Merg Outlook - Calandaring 3 February 24th 07 06:23 AM
FAX ISSUE lukad2000 Outlook - General Queries 5 December 1st 06 02:55 PM


All times are GMT +1. The time now is 08:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.