Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write a formula into EXCEL

Status
Not open for further replies.

VojtaR

Automotive
Joined
Apr 2, 2020
Messages
20
Location
CZ
Hello,

I am looking everywhere for a way how to write a formula into cell, but am keep getting this error:

---------------------------
CNEXT - CATScriptErrorMessages - ScriptingERR_1002
---------------------------
Execute the script "Excel formulas.CATScript".
The scripting engine for CATScript has reported the following error:

Source: Microsoft VBScript runtime error
Description: Unknown runtime error
Line: 13
Column: 0



Here is my code:
Code:
Sub CATMain()

Set Excel = CreateObject("Excel.Application")
Excel.visible = true

Set workbooks = Excel.Application.workbooks
Set myworkbook = Excel.workbooks.Add
Set objsheet1 = Excel.Sheets.Add


objsheet1.Cells(1, 1) = "Part Name"
objsheet1.Cells(1, 2) = "Localization"
objsheet1.Cells(2, 2) = "=LEFT($A2;2)"
   
End Sub

Can anyone help me with that?

Thanks
 
[bugeyed] Did you try excel forum ???? [bugeyed]

btw... seems Left formula is more like Left($A2,2)

Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top