Skip to content

VBA returns old error #1158

Description

@mfreak95

Windows 10

XLwings 15.9, Excel Office 365, Python 3.7

The issue i have is that after i run a par of code that gives an error, when i solve the issue in either python or VBA and rerun the code exactly the same error is given. To me it seems like the python environment sticks in this old error. And it does not take the new code. Any solutions for this?

 File "<string>", line 1

    import sys, os; sys.path[0:0]=os.path.normcase(os.path.expandvars(r'C:\Users\Mark Buis\OneDrive - Focus Orange Advisory B.V;C:\Users\Mark Buis\OneDrive - Focus Orange Advisory B.V\TickerIDRetriever.zip;')).split(';'); import hello2; hello2.scrapeAndPrint(ALX:AEX1)

                                                                                                                                                                                                                                                                      ^

SyntaxError: invalid syntax

VBA:

Sub getInfoTickerIDS()
    Dim i As Integer
    Dim IDArray
    IDS = getAmountOfIDS()
    IDArray = Range("A6:A" & (IDS + 5)).Value
    Sheets("Dashboard").Range("C2:C3").Value = IDArray
    
    For i = 1 To IDS
        ID = IDArray(i, 1)
        Sheets("Dashboard").Range("E2").Value = ID
        RunPython ("import hello2; hello2.scrapeAndPrint(" & ID & "," & i & ")")
    Next i
    
End Sub

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions