Opening a file

  • Thread starter Thread starter Salo
  • Start date Start date
S

Salo

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
 
Workbooks.Open Filename:="N:\Files\Files 2004-2005" & _
"\File_0405\SYSTEMFILES\PREVMON\" & PeriodFile & _
".xls", UpdateLinks:=0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top