Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default End command not working

Sub LastRow()
Set ex = GetObject(, "excel.application")


ex.worksheets("Sheet5").Activate

LR = ex.Range("A65536").End(xlup).Row

set ex = nothing

End Sub

When I run this sub I get object define or applicaiton define error
when the code executes LR = ex.Range("A65536").End(xlup).Row line.

Any help is really appreciated.

Thanks

Sonu

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default End command not working

I am trying to run this from power point

sonu wrote:
Sub LastRow()
Set ex = GetObject(, "excel.application")


ex.worksheets("Sheet5").Activate

LR = ex.Range("A65536").End(xlup).Row

set ex = nothing

End Sub

When I run this sub I get object define or applicaiton define error
when the code executes LR = ex.Range("A65536").End(xlup).Row line.

Any help is really appreciated.

Thanks

Sonu


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default End command not working

Hi Sonu,

change
LR = ex.Range("A65536").End(xlup).Row

to
x = ex.Range("A65536").End(-4162&).Row

The xl constants won't be recognized if you are using 'Late Binding'.

Regards,
Peter T

"sonu" wrote in message
ups.com...
I am trying to run this from power point

sonu wrote:
Sub LastRow()
Set ex = GetObject(, "excel.application")


ex.worksheets("Sheet5").Activate

LR = ex.Range("A65536").End(xlup).Row

set ex = nothing

End Sub

When I run this sub I get object define or applicaiton define error
when the code executes LR = ex.Range("A65536").End(xlup).Row line.

Any help is really appreciated.

Thanks

Sonu




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default End command not working


Thanks peter it is working now

On Nov 27, 6:15 pm, "Peter T" <peter_t@discussions wrote:
Hi Sonu,

change LR = ex.Range("A65536").End(xlup).Rowto
x = ex.Range("A65536").End(-4162&).Row

The xl constants won't be recognized if you are using 'Late Binding'.

Regards,
Peter T

"sonu" wrote in oglegroups.com...



I am trying to run this from power point


sonu wrote:
Sub LastRow()
Set ex = GetObject(, "excel.application")


ex.worksheets("Sheet5").Activate


LR = ex.Range("A65536").End(xlup).Row


set ex = nothing


End Sub


When I run this sub I get object define or applicaiton define error
when the code executes LR = ex.Range("A65536").End(xlup).Row line.


Any help is really appreciated.


Thanks


Sonu- Hide quoted text -- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default End command not working

This might do it.

LR = ex.Worksheets(5).Range("A65536").End(xlUp).Row

"sonu" wrote:

I am trying to run this from power point

sonu wrote:
Sub LastRow()
Set ex = GetObject(, "excel.application")


ex.worksheets("Sheet5").Activate

LR = ex.Range("A65536").End(xlup).Row

set ex = nothing

End Sub

When I run this sub I get object define or applicaiton define error
when the code executes LR = ex.Range("A65536").End(xlup).Row line.

Any help is really appreciated.

Thanks

Sonu





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default End command not working

The XL object model is Application - Workbook - Worksheet - Range. You are
trying to go directly from the Application directly to the worksheet without
identifying the Workbook, which it will not like. Try something more like...

Sub LastRow()
Set ex = GetObject(, "excel.application")


LR =
ex.Workbooks("Book1.xls").worksheets("Sheet5").Ran ge("A65536").End(xlup).Row

set ex = nothing

End Sub

--
HTH...

Jim Thomlinson


"sonu" wrote:

I am trying to run this from power point

sonu wrote:
Sub LastRow()
Set ex = GetObject(, "excel.application")


ex.worksheets("Sheet5").Activate

LR = ex.Range("A65536").End(xlup).Row

set ex = nothing

End Sub

When I run this sub I get object define or applicaiton define error
when the code executes LR = ex.Range("A65536").End(xlup).Row line.

Any help is really appreciated.

Thanks

Sonu



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
SUM command not working Craig Excel Worksheet Functions 1 November 22nd 06 05:09 PM
end command not working sonu[_2_] Excel Programming 7 September 13th 06 06:06 PM
ChangeLink Command Not Working Dina Excel Programming 8 February 17th 06 03:55 AM
command button isn't working Nydia New Users to Excel 1 April 29th 05 10:31 PM
Kill command not working Larry Wood Excel Programming 1 May 15th 04 02:06 PM


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

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

About Us

"It's about Microsoft Excel"