View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Greg Koppel Greg Koppel is offline
external usenet poster
 
Posts: 79
Default xl2002 doesn't understand macro written under xl2000

What value does i have before the loop?

"sarasta " wrote in message
...
I'd appreciate very much if anyone could explain me this mystique :

Under xl2000 I've written such a code :

'------------------------------------------------------------------

Dim file_name as Variant

file_name = array("c:\first.xls","c:\second.xls")

Do Until i N

Workbooks.OpenText Filename:=file_name(i), Origin:= _
xlWindows,... (other parameters)


i = i +1
Loop


'--------------------------------------------------------------------------

So, under xl2000 it works fine, but under xl2002 the open method fails
because of parameter Filename doesn't understand an array element. If I
change parameter's Filename value to Filename := "c:\first.xls" it
works fine under xl2002.

Please, if someone knows how to solve this problem, help me. I'd
appreciate your help very much.


---
Message posted from http://www.ExcelForum.com/