LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Getting the LastRow in ExcelSheet from Word

I'm trying to find the last used row in column C in a sheet, using
automation from Word.

I use the following code:


Dim rk As Integer
On Error Resume Next
Set xlapp = GetObject(, "Excel.application")
If Err.Number < 0 Then
Set xlapp = CreateObject("excel.Application")
End If
xlapp.Workbooks.Open FileName:= _
"C:\Documents and Settings\Administrator\Dokumenter\Deltagere.xls"
xlapp.Visible = True
rk = xlapp.activeworkbook.sheets(1).Range("c65536").End (xlUp).Row
It opens the workbook and selects the last used cell in column C, but rk
return a 0 in stead of thec expected 27 in this case. How can I Find the row
number of last used cell in column C?

Jan


 
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
call excelsheet within excelsheet when user clicks excelsheet ico mohini Excel Worksheet Functions 0 November 20th 06 05:07 AM
How to use a macro from another excelsheet Jeroen[_2_] Excel Programming 4 May 24th 06 03:21 PM
Protected Excelsheet ngmahesh Excel Programming 2 January 6th 06 01:31 PM
how to use an excelsheet that is already in my userform Jean-Pierre D via OfficeKB.com Excel Programming 0 August 19th 05 08:19 AM
Go to lastrow using other column's lastrow stakar[_14_] Excel Programming 5 April 16th 04 03:42 PM


All times are GMT +1. The time now is 09:28 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"