Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

why I can't figure it out..

  Asked By: Caleb    Date: Aug 16    Category: MS Office    Views: 634
  

From the VB side, I'm trying to do a simple evaluation of two
different workbooks; specifically, certain cells in each workbook.

Ok, I CAN do it by setting a workbook to be 'active' and then getting
my data, switching the other to active, then doing the same. I can
even hide it by turning off application updating.

But WHY can't I do...

MyVariable = Workbook("TestBook1.xls").sheets("Sheet1").cells("b1") ?

Is it simply an issue of I can go that many layers deep? Would doing a
With statement work? ARGHH! Dunno WHY this simple issue is driving
me up a wall. but any thoughts would be helpful. :)

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Ryan Evans     Answered On: Aug 16

Try

MyVariable = Workbook("TestBook1.xls").sheets("Sheet1").cells(1,2)

or

MyVariable = Workbook("TestBook1.xls").sheets("Sheet1").Range("b1")

 
Didn't find what you were looking for? Find more on why I can't figure it out.. Or get search suggestion and latest updates.




Tagged: