S
Sydious
I would like to set up a button that when pressed, would open the
coresponding Excel spreadsheet. The speadsheet file name would be that same
thing each time but would have the coresponding date added to it. Example
file names:
"Test_Sheet_02_01_2008"
"Test_Sheet_02_02_2008"
"Test_Sheet_02_02_2008"
This is the VBA Code that i have so far. I assume I am going wrong with
trying to reference the txt box value.
Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
Dim stAppName As String
stAppName = "Excel.exe
\\broan-nutone.com\broan\Logistics\shiftmetrics\Performance\Test_Sheet_" &
[Forms!].[Form1].[txtFileDate].[Value]
Call Shell(stAppName, 1)
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub
The text box value would have "2-01-2008" entered into it.
The desired result would be it opening sheet "Test_Sheet_2-01-2008"
If this is possible, could this also be modified to import data from that
sheet also using a diffrent button?
coresponding Excel spreadsheet. The speadsheet file name would be that same
thing each time but would have the coresponding date added to it. Example
file names:
"Test_Sheet_02_01_2008"
"Test_Sheet_02_02_2008"
"Test_Sheet_02_02_2008"
This is the VBA Code that i have so far. I assume I am going wrong with
trying to reference the txt box value.
Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
Dim stAppName As String
stAppName = "Excel.exe
\\broan-nutone.com\broan\Logistics\shiftmetrics\Performance\Test_Sheet_" &
[Forms!].[Form1].[txtFileDate].[Value]
Call Shell(stAppName, 1)
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub
The text box value would have "2-01-2008" entered into it.
The desired result would be it opening sheet "Test_Sheet_2-01-2008"
If this is possible, could this also be modified to import data from that
sheet also using a diffrent button?