dillard720
New Member
- Joined
- Oct 12, 2011
- Messages
- 11
I am stuck and would appreciate any help that can assist me.
I have an access database in whcih I upload data from different excel spreadsheets. In access the user clicks a button which a browsing window opens and they select the file they want to upload. The code then continues the upload process. In each of the available spreadsheets i have a constant which has the template type (Public Const TEMPLATE_NAME = "SCO Proposal"
Public Const TEMPLATE_VERSION = "2.62"). From Access, when the browsed template is open, I need to look up the TEMPLATE_NAME in the excel file in order to know which upload code to run.
Something like this:
Private Sub btn_Attachfile_Click()
Dim rs As DAO.Recordset
Dim appExcel As Excel.Application
Dim wb As Excel.Workbook
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSaveRecord
'browse for upload file
sBrowsingWindow
Set appExcel = CreateObject("Excel.application")
Set wb = appExcel.Workbooks.Open(gsFilePath, , ReadOnly = True)
'Chcek TEMPLATE_NAME here
Select Case TEMPLATE_NAME
Case "SCO Proposal"
upload instructions
Case "ISCM"
upload instructions
Case "IFT"
upload instructions
Case Else
End Select
My issue: I don't know how to look up TEMPLATE_NAME in excel from my access database.
Help, please!
I have an access database in whcih I upload data from different excel spreadsheets. In access the user clicks a button which a browsing window opens and they select the file they want to upload. The code then continues the upload process. In each of the available spreadsheets i have a constant which has the template type (Public Const TEMPLATE_NAME = "SCO Proposal"
Public Const TEMPLATE_VERSION = "2.62"). From Access, when the browsed template is open, I need to look up the TEMPLATE_NAME in the excel file in order to know which upload code to run.
Something like this:
Private Sub btn_Attachfile_Click()
Dim rs As DAO.Recordset
Dim appExcel As Excel.Application
Dim wb As Excel.Workbook
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSaveRecord
'browse for upload file
sBrowsingWindow
Set appExcel = CreateObject("Excel.application")
Set wb = appExcel.Workbooks.Open(gsFilePath, , ReadOnly = True)
'Chcek TEMPLATE_NAME here
Select Case TEMPLATE_NAME
Case "SCO Proposal"
upload instructions
Case "ISCM"
upload instructions
Case "IFT"
upload instructions
Case Else
End Select
My issue: I don't know how to look up TEMPLATE_NAME in excel from my access database.
Help, please!