Thread: Opening a file
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Salo Salo is offline
external usenet poster
 
Posts: 1
Default Opening a file

Hi all,

I want a form to pop up asking for a file number, then on
clicking OK the file with the number opens e.g File_1.

Private Sub EntryButtonP_Click()

Dim PeriodFile As String

PeriodFile = "File_0405_P" & GetPrevPeriod.PeriodBox

Workbooks.Open Filename:="N:\Files\Files 2004-2005
\File_0405\SYSTEMFILES\PREVMON\" & PeriodFile.xls,
UpdateLinks:=0

End Sub

I've tried putting PeriodFile & xls, and PeriodFile
& ".xls", but it doesn't seem to work. Can anyone help.

Many thanks