View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Need help with VB Excel statement

workbooks.Open FileName:=Dir, UpdateLinks:=k

This assume the variable Dir holds a fully qualified path with filename or
if the file is in the default directory/drive, then just the filename.

However, there is a VBA function named Dir, so you might want to use a
different variable name for this variable.

--
Regards,
Tom Ogilvy


" wrote:

Hi, can someone please give me the syntax for Excel VB statement to
open a worksheet, which is named in "INDEX(dir, k)". In my XLM
program the statement is simply "=OPEN(dir,k)", but I can't seem to
figure out how to write it in VB. Many thanks in advance.