PeterPan9720 Posted July 1, 2018 Share Posted July 1, 2018 Please somebody can help me in a little issue ? I'm trying to have an excel interface in order to write some drawing blocks attribute excration. Here below code: Dim NUOVA_ISTANZA As Object Dim WRKB As Workbook ' Attribuzione della variabile "Cartella di lavoro Excel" Dim WRKS As Worksheet ' Attribuzione della variabile "Foglio di lavoro" On Error GoTo MESSAGGIO_ERRORE Set NUOVA_ISTANZA = GetObject(, "Excel.Application") ' Attribusce alla variabile "NUOVA_ISTANZA" l'applicazione Excel: se Excel non è aricatot restituisec un errore Set WRKB = NUOVA_ISTANZA.Workbooks.Add ' Attribuisce alla variabile WRKB la cartella di lavoro Excel corrente Set WRKS = NUOVA_ISTANZA.ActiveSheet Now, I got an error message on WRKB As Workbook instruction "User defined type not defined". If I continue without variable dim, later when I'm trying to set an excel sheet formatting as border and other cells formatting With WRKS.Columns(2).Resize(, 3) ' Bordo destro e sinistro colonne coordinate .Borders(xlEdgeLeft).LineStyle = xlContinuous .Borders(xlEdgeRight).LineStyle = xlContinuous .Borders(xlInsideVertical).LineStyle = xlContinuous End With I got an error "Application-defined or object-defined error" Please help me Quote Link to comment Share on other sites More sharing options...
Cleyton Ramos Posted November 2, 2018 Share Posted November 2, 2018 Hello! You need firstly to set a excel reference, so you will get manipulate what you want. Let's try help with a litle example: This error "Application-defined or object-defined error" is typical ausency of the object. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.