home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,353 of 10,840   
   Peter to Peter   
   Re: VBA and Excel - Workbook opening pro   
   27 Mar 05 13:58:59   
   
   From: gammaNO@SPAMblueyonder.co.uk   
      
   and heres another funny   
       If I use   
           LastRow = Cells.SpecialCells(xlCellTypeLastCell).Row   
       it works fine in the subroutine but returns 1 from the Function even   
   when my target workbook (Two.xls) is open   
      
   AHHHHHHHHHH   
   --   
   Peter   
   To err is human but it takes a computer to really mess things up!   
      
   "Peter"  wrote in message   
   news:chy1e.14216$XH5.11163@fe1.news.blueyonder.co.uk...   
   > If I have workbook "one.xls" open and try to open a second workbook from   
   > within a subroutine using   
   >   
   > Workbooks.Open "E:\Data\Excel\Two.xls"   
   >   
   > "Two.xls" opens as expected.   
   >   
   > but if I place the same line of code in a Function rather than a   
   > subroutine "Two.xls" does not open!   
   >   
   > Any ideas?  All I'm trying to do is to extract some data from one sheet &   
   > copy it to another.   
   >   
   >   
   > --   
   > Peter   
   > To err is human but it takes a computer to really mess things up!   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca