Results 1 to 4 of 4

Windows(Filename).Activate

Threaded View

  1. #1
    Registered User
    Join Date
    02-21-2009
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Windows(Filename).Activate

    I write my macro like this...

     
    Private Sub CommandButton1_Click()
    Filename = Application.GetOpenFilename
    Workbooks.Open Filename:=Filename
    Windows(Filename).Activate
         Range("A1").Select
         Range(Selection, Selection.End(xlToRight)).Select
         Range(Selection, Selection.End(xlDown)).Select
         Selection.Copy
     
    Windows("Rofin Pareto1.xls").Activate
         Sheets("Raw Data").Range("A1").Select
         ActiveSheet.Paste
    End Sub
    but when come to :Windows(Filename).Activate"..it will pop out to debug wit error..."Subcript out of range"...any1 can help me...urgent!

    it also not work with the filename without space....i did not open the file also during run...any idea?
    Last edited by VBA Noob; 02-21-2009 at 06:01 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1