ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening a file (https://www.excelbanter.com/excel-programming/304499-opening-file.html)

Salo

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

Tom Ogilvy

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

--
Regards,
Tom Ogilvy

"Salo" wrote in message
...
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





All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com