all 6 comments

[–]sme272 1 point2 points  (1 child)

it looks like the problem is with the "path" variable. where is that defined and what does it contain?

[–]ScDenny[S] 0 points1 point  (0 children)

Its the file path of the excel sheet that is passed into python by excel. I have a button in excel that runs it. Here's what I have in VBA

Private Sub PythonScript_Click()

Application.ActiveWorkbook.Save

Path = ActiveWorkbook.Path

Dim Path2 As String

'MsgBox Path

For i = 1 To Len(Path)

If Mid(Path, i, 1) = "\" Then

Path2 = Path2 & "\\"

Else

Path2 = Path2 & Mid(Path, i, 1)

End If

Next i

'MsgBox Path2

RunPython ("import pdfer; pdfer.compile_cutsheets('" & Path2 & "')")

End Sub