Hi,
I have the following part of my code
If Dir(HMC_Path & Me.HMC_ID & " - " & HMC_Des & ".xlsx") = "" Then
MsgBox "HMC Excel file doesn't exists in the system" & vbCrLf & _
"Contact the Design Engineer."
GoTo LastLine
Else
Dim appexcel As Object
FName = Me.HMC_ID2 & " - " & HMC_Des & ".xlsx"
Set appexcel = CreateObject("Excel.Application")
'Open Workbook
appexcel.Workbooks.Open HMC_Path & FName
appexcel.Visible = False
'Input the Data into the HMC
appexcel.Worksheets("RECIPE").Range("K4").Value = Round(Me.mLength, 2)
appexcel.Worksheets("RECIPE").Range("Q8").Value = Me.HoseWO
appexcel.Worksheets("RECIPE").Range("Q12").Value = Me.SO
appexcel.Worksheets("RECIPE").Range("V10").Value = Me.HoseDesc2
A want to add a value from access to a different worksheet (this value is text), I was trying with the below after the last line:
appexcel.Worksheets("Component list").Range("M47").Value = Me.Branding_type
However is not working. Do I need to consider something else? The worksheet is on the same file.
really appreciated for your comments
I have the following part of my code
If Dir(HMC_Path & Me.HMC_ID & " - " & HMC_Des & ".xlsx") = "" Then
MsgBox "HMC Excel file doesn't exists in the system" & vbCrLf & _
"Contact the Design Engineer."
GoTo LastLine
Else
Dim appexcel As Object
FName = Me.HMC_ID2 & " - " & HMC_Des & ".xlsx"
Set appexcel = CreateObject("Excel.Application")
'Open Workbook
appexcel.Workbooks.Open HMC_Path & FName
appexcel.Visible = False
'Input the Data into the HMC
appexcel.Worksheets("RECIPE").Range("K4").Value = Round(Me.mLength, 2)
appexcel.Worksheets("RECIPE").Range("Q8").Value = Me.HoseWO
appexcel.Worksheets("RECIPE").Range("Q12").Value = Me.SO
appexcel.Worksheets("RECIPE").Range("V10").Value = Me.HoseDesc2
A want to add a value from access to a different worksheet (this value is text), I was trying with the below after the last line:
appexcel.Worksheets("Component list").Range("M47").Value = Me.Branding_type
However is not working. Do I need to consider something else? The worksheet is on the same file.
really appreciated for your comments