Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Command button failure

Why does the following fail @ Range("D2").Select

Rum-time error '1004"
Application-defined or object-defined error

If I run the exact same code in a Macro it works fine

Private Sub CommandButton1_Click()

Workbooks.Add
ActiveWorkbook.SaveAs Filename:="TempData.xls"
Windows("testbook.XLS").Activate
Range("D2:D7").Select
Selection.Copy
Windows("TempData.XLS").Activate
Range("D2").Select
ActiveSheet.Paste

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Command button failure

Hello!

I change one row, and it works me!

Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect

Regards Kari J Keinonen
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Command button failure

When I replace "Windows("TempData.XLS").Activate" with

Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect

I get a 1004 "Select method of Range class failed" at this new line

oldjay




"Kari J Keinonen" wrote:

Hello!

I change one row, and it works me!

Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect

Regards Kari J Keinonen

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Command button failure

Hy!

I don't replace that row.

Regards Kari J Keinonen

"Oldjay" wrote:

When I replace "Windows("TempData.XLS").Activate" with

Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect

I get a 1004 "Select method of Range class failed" at this new line

oldjay




"Kari J Keinonen" wrote:

Hello!

I change one row, and it works me!

Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect

Regards Kari J Keinonen

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Command button failure

What row did you replaced??

"Kari J Keinonen" wrote:

Hy!

I don't replace that row.

Regards Kari J Keinonen

"Oldjay" wrote:

When I replace "Windows("TempData.XLS").Activate" with

Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect

I get a 1004 "Select method of Range class failed" at this new line

oldjay




"Kari J Keinonen" wrote:

Hello!

I change one row, and it works me!

Workbooks("TempData.XLS").Sheets(1).Range("D2").Se lect

Regards Kari J Keinonen

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
vlookup failure & ctrl-f failure? joemeshuggah Excel Discussion (Misc queries) 4 December 22nd 08 07:22 PM
VB's Command Button vs Form's Command Button Ronald Dodge Excel Programming 3 May 24th 06 02:23 PM
Command Button Macro Execution Failure Dick Scheibe[_2_] Excel Programming 0 August 22nd 05 10:40 PM
OnAction command failure [email protected] Excel Programming 4 November 18th 03 07:50 PM
Command Button vs Control Button RGibson Excel Programming 1 October 14th 03 02:24 AM


All times are GMT +1. The time now is 10:43 PM.

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

About Us

"It's about Microsoft Excel"