ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   end command not working (https://www.excelbanter.com/excel-programming/372799-end-command-not-working.html)

sonu[_2_]

end command not working
 
I want to control Excel from MS access. I created exapp object.
everyting woks right but I can use this following command. Any help is
really appreciated.

for each wks in exApp.worksheets
lstcolumn = exApp.worksheets(wks.name).Range("A65536").end(xlu p).row

next


Tom Ogilvy

end command not working
 
for each wks in exApp.worksheets
lstcolumn = exApp.worksheets(wks.name).Range("A65536").end(-4162 ).row

next

--
Regards,
Tom Ogilvy


"sonu" wrote:

I want to control Excel from MS access. I created exapp object.
everyting woks right but I can use this following command. Any help is
really appreciated.

for each wks in exApp.worksheets
lstcolumn = exApp.worksheets(wks.name).Range("A65536").end(xlu p).row

next



Jim Thomlinson

end command not working
 
The app contains workbook. Workbooks contain sheets and sheets contain
ranges. You jump right from the app to the sheet without specifying a
workbook. Specify the book that you are working on and all should be well...
--
HTH...

Jim Thomlinson


"sonu" wrote:

I want to control Excel from MS access. I created exapp object.
everyting woks right but I can use this following command. Any help is
really appreciated.

for each wks in exApp.worksheets
lstcolumn = exApp.worksheets(wks.name).Range("A65536").end(xlu p).row

next



sonu[_2_]

end command not working
 
I specify the workbook name also but it still does not work
Jim Thomlinson wrote:
The app contains workbook. Workbooks contain sheets and sheets contain
ranges. You jump right from the app to the sheet without specifying a
workbook. Specify the book that you are working on and all should be well...
--
HTH...

Jim Thomlinson


"sonu" wrote:

I want to control Excel from MS access. I created exapp object.
everyting woks right but I can use this following command. Any help is
really appreciated.

for each wks in exApp.worksheets
lstcolumn = exApp.worksheets(wks.name).Range("A65536").end(xlu p).row

next




sonu[_2_]

end command not working
 
Thanks Tom this is working now.


Tom Ogilvy wrote:
for each wks in exApp.worksheets
lstcolumn = exApp.worksheets(wks.name).Range("A65536").end(-4162 ).row

next

--
Regards,
Tom Ogilvy


"sonu" wrote:

I want to control Excel from MS access. I created exapp object.
everyting woks right but I can use this following command. Any help is
really appreciated.

for each wks in exApp.worksheets
lstcolumn = exApp.worksheets(wks.name).Range("A65536").end(xlu p).row

next




Jim Thomlinson

end command not working
 
Post what you now have (the whole thing). Also you may need to use the number
(-4162) in place of xlUp as Tom suggested. If I am correct that depends on
how you bound the object... Also I assume that you have opened the book that
you are working on???
--
HTH...

Jim Thomlinson


"sonu" wrote:

I specify the workbook name also but it still does not work
Jim Thomlinson wrote:
The app contains workbook. Workbooks contain sheets and sheets contain
ranges. You jump right from the app to the sheet without specifying a
workbook. Specify the book that you are working on and all should be well...
--
HTH...

Jim Thomlinson


"sonu" wrote:

I want to control Excel from MS access. I created exapp object.
everyting woks right but I can use this following command. Any help is
really appreciated.

for each wks in exApp.worksheets
lstcolumn = exApp.worksheets(wks.name).Range("A65536").end(xlu p).row

next





Allllen

end command not working
 
Tom, why? What is the -4162?

--
Allllen


"Tom Ogilvy" wrote:

for each wks in exApp.worksheets
lstcolumn = exApp.worksheets(wks.name).Range("A65536").end(-4162 ).row

next

--
Regards,
Tom Ogilvy


"sonu" wrote:

I want to control Excel from MS access. I created exapp object.
everyting woks right but I can use this following command. Any help is
really appreciated.

for each wks in exApp.worksheets
lstcolumn = exApp.worksheets(wks.name).Range("A65536").end(xlu p).row

next



sonu[_2_]

end command not working
 
It is the value for xlup command. my code works with this command
because i have a late binding.



All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com