03Explorer
Technical User
Trying to create a module that I can call from the form code that will manipulate an open Excel file.
[Code Form-Subroutine]Dim MyXL As Object
Dim objActivdeWkb As Object
Set MyXL = CreateObject("Excel.Application")
'--Further down in the code I want to call a Subroutine in a Module so I can simplify coding repeating
Call SoftSkills()
[/Code]
[Code SoftSkills]MyXL.Sheets(1).copy after:=MyXL.Worksheets(MyXL.Worksheets.Count)
MyXL.ActiveSheet.range("A23") = Forms![frmAAS].cboPracticeType.Value & " CRM Assessment Form"
MyXL.Rows("32:41").Delete
MyXL.ActiveSheet.Protect[/Code]
I get an error in SoftSkills "Object Required" I believe it's tied to MyXL... do I need to reDefine? and then point to the open Excel file I am manipulating?
[Code Form-Subroutine]Dim MyXL As Object
Dim objActivdeWkb As Object
Set MyXL = CreateObject("Excel.Application")
'--Further down in the code I want to call a Subroutine in a Module so I can simplify coding repeating
Call SoftSkills()
[/Code]
[Code SoftSkills]MyXL.Sheets(1).copy after:=MyXL.Worksheets(MyXL.Worksheets.Count)
MyXL.ActiveSheet.range("A23") = Forms![frmAAS].cboPracticeType.Value & " CRM Assessment Form"
MyXL.Rows("32:41").Delete
MyXL.ActiveSheet.Protect[/Code]
I get an error in SoftSkills "Object Required" I believe it's tied to MyXL... do I need to reDefine? and then point to the open Excel file I am manipulating?