Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I have the above error msg on this line:- Private Sub cmdAddBtn1_Click() ActiveWorkbook.Sheets("HEA Payments").Activate Sheets("HEA Payments").Range("A1").End(xlDown).Offset(1, 0).Select What is wrong or how do i reference it? Tx. garrygdc *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your code ran fine for me.
Code was in the worksheet module of a sheet having cmdAddBtn1 and this sheet was not HEA Payments. HEA Payments and the sheet with the code were in the same workbook. -- Regards, Tom Ogilvy "Garry" wrote in message ... Hello I have the above error msg on this line:- Private Sub cmdAddBtn1_Click() ActiveWorkbook.Sheets("HEA Payments").Activate Sheets("HEA Payments").Range("A1").End(xlDown).Offset(1, 0).Select What is wrong or how do i reference it? Tx. garrygdc *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom
Is was working fine for me then started with that error?? The actual worksheet is on a network drive that everyone has access too?? full path is F:\hea..\...\payments.xls. Having said that no-one should be accessing it as they would not know it was actually there. Are there any flags or settings that I should be resetting? garrygdc *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If it is in another workbook, then the code should be
Private Sub cmdAddBtn1_Click() ActiveWorkbook.Sheets("HEA Payments").Activate Activeworkbook.Sheets("HEA Payments").Range("A1") _ .End(xlDown).Offset(1, 0).Select End Sub -- Regards, Tom Ogilvy "Garry" wrote in message ... Tom Is was working fine for me then started with that error?? The actual worksheet is on a network drive that everyone has access too?? full path is F:\hea..\...\payments.xls. Having said that no-one should be accessing it as they would not know it was actually there. Are there any flags or settings that I should be resetting? garrygdc *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Tom Tx for the quick reply. No that didn't work either. I tried a reboot too. Could I be Activating the workbook/sheet too many times? What would be the fully qualified statement? Tx garrygdc *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well there is no way to click a button on a worksheet and have another
workbook be the activeworkbook - should have recognized that fallacy from the start. If you want to select a range in another workbook, you would need to activate that workbook first. Private Sub cmdAddBtn1_Click() Workbooks("HEA Payments.xls").Activate ActiveWorkbook.Sheets("HEA Payments").Activate Activeworkbook.Sheets("HEA Payments").Range("A1") _ .End(xlDown).Offset(1, 0).Select End Sub Change the first line of code to reflect the actual name of the workbook. -- Regards, Tom Ogilvy "Garry" wrote in message ... Tom Tx for the quick reply. No that didn't work either. I tried a reboot too. Could I be Activating the workbook/sheet too many times? What would be the fully qualified statement? Tx garrygdc *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error 1004 Application Defined or Object Defined Error | Excel Programming | |||
Macro Run-time Error 1004 Application Defined or Object Defined Error | Excel Programming | |||
"Run Time Error 1004 Application Defined or Object Defined Error." | Excel Programming | |||
Runtime Error 1004 -- Application Defined or Object Defined Error | Excel Programming |