+ Reply to Thread
Results 1 to 4 of 4

Windows(Filename).Activate

  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...

    Please Login or Register  to view this content.
    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.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Windows(Filename).Activate

    A few points...

    I wouldn't use Filename as a variable name ... GetOpenFilename will return a Full Path as required in the Workbooks.Open command whereas when using Windows(name) you require just the filename (as you use later for the other file)

    ... it's not clear whether the Rogin Pareto1.xls is the workbook in which the code resides ... I'm assuming it is... does the following help:

    Please Login or Register  to view this content.
    Note: when you open a workbook it immediately becomes the activeworkbook so you don't actually need to run the Activate command

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

    Re: Windows(Filename).Activate

    seems no error but did not copy anything into the pareto rofin sheets...what is the problem?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Windows(Filename).Activate

    With no knowledge of what resides in the file you're opening it's pretty hard to comment.

    I would first suggest that you enter "a" into cell A1 on "Raw Data" sheet, run the routine... once the routine has run check to see if A1 on "Raw Data" sheet is still "a" ?

+ Reply to Thread

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