Comments (18)
Hello shends,
Could you please check if a folder called xlpython
has been created in the same folder as your workbook, and if so whether it contains the file xlpython.bas
?
from excelpython.
Thank you fro the fast response:)
Yes, so this is how it looks like
Computer > Local C> Project > xlpython folder & test.xlsm (workbook folder)
and inside the xlpython folder there is file xlpython.bas
from excelpython.
What error message is VBA giving? Can you attach a screenshot?
from excelpython.
This is the error message that I am getting right now.
from excelpython.
Ok thanks, I am a bit confused however, because it is a different line from the one you mentioned, and also I cannot see any VBA error message.
You can see the VBA error message by typing ?Err.Description
into the immediate window (the white box at the bottom of the screen)
from excelpython.
After I type in ?Err.Description, it says "It can not find the path"
Excel is not in English so it translated into... "It can not find the path"
My problem is when I click "Setup ExcelPython" button, it says..
"This action will:... Do you want to proceed?" and I answer "Yes" then the "76 runtime error" occurs.
from excelpython.
Ok, I see, please bear with me, can you please give me the output of the following in the immediate window:
?ThisWorkbook.Path
from excelpython.
I think the problem may be something to do with the characters (are they Chinese?). In fact I don't understand why it is showing a different character instead of a \
for example \xlpython
. Is that normal?
from excelpython.
If the problem really is the \
character, maybe we can fix it by using Application.PathSeparator
instead. Please let me know if replacing the relevant lines with the following VBA code works.
If fso.FolderExists(wb.Path + Application.PathSeparator + "xlpython") Then
isVersionOK = False
ver = "?.?.?"
For Each f In fso.GetFolder(ThisWorkbook.Path + Application.PathSeparator + "xlpython").Files
If LCase$(Right$(f, 4)) = ".dll" Then
isVersionOK = fso.FileExists(wb.Path + Application.PathSeparator + "xlpython" + Application.PathSeparator + fso.GetFileName(f))
ver = Mid$(fso.GetBaseName(f), InStr(fso.GetBaseName(f), "-") + 1)
Exit For
End If
Next f
If Not isVersionOK Then
MsgBox "The installation folder already exists, but it does not contain ExcelPython version " + ver + "." _
+ vbCrLf + vbCrLf + "Installation folder: " + wb.Path + Application.PathSeparator + "xlpython" _
+ vbCrLf + vbCrLf + "To set up a fresh install please delete it and try again. Note that you may need to close Excel to delete it." _
, vbCritical, "Error installing ExcelPython runtime"
Exit Sub
End If
Else
fso.CopyFolder ThisWorkbook.Path + Application.PathSeparator + "xlpython", wb.Path + Application.PathSeparator + "xlpython"
End If
On Error GoTo not_present
wb.VBProject.VBComponents.Remove wb.VBProject.VBComponents("xlpython")
not_present:
On Error GoTo 0
wb.VBProject.VBComponents.Import wb.Path + Application.PathSeparator + "xlpython" + Application.PathSeparator + xlpython.bas"
' create skeleton py file
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(wb.Path + Application.PathSeparator + fso.GetBaseName(wb.name) + ".py") Then
Set f = fso.CreateTextFile(wb.Path + Application.PathSeparator + fso.GetBaseName(wb.name) + ".py", True)
f.WriteLine "from xlpython import *"
f.Close
End If
from excelpython.
Thank you for helping me out. I really apprecaite it.
So, when I type the following: "?ThisWorkbook.Path"
"C:\Project\xlpython"
This is the output file.
from excelpython.
ok i see, so you have unzipped the add-in in the folder c:\project\xlpython
, i don't know if possibly this creates a problem when the setup tries to copy the c:\project\xlpython\xlpython
folder to c:\project\xlpython
.
try creating another folder c:\project2
, saving a new workbook there and try again, so that way no conflicts are created
from excelpython.
So, after following your instruction, and clicking on SetupExcelPython button, the error occurs saying "76 runtime error" and when I debug it, the yellow line is on the following line
from excelpython.
And when I uncommented that line, it successfully created test2.py file in c:\project2 folder. (yay!)
Wait, but is it ok to uncomment that line?
from excelpython.
Well... not really.
So I will explain, what the 'setup' button does is the following
- Copies the
xlpython
folder from the folder containingxlpython.xlam
to the folder containing your workbook - Imports the module
xlpython\xlpython.bas
into your workbook, thus creating thexlpython
VBA module - Creates the file
test2.py
with the linefrom xlpython import *
to get you started.
So the first two steps are necessary for everything to work. If you have seen that the xlpython
folder has been created, that the DLLs are in that directory, and you can import xlpython\xlpython.bas
manually, then it will all work.
But I still can't understand why the add-in is failing unfortunately.
from excelpython.
Shends, do you have TeamViewer? If so I can give you remote assistance. You can send me the id/password by email.
from excelpython.
That would be great! Let me download TeamViewer right now. Where can I find your email?
from excelpython.
Thank you so much by following the
https://github.com/ericremoreynolds/excelpython/blob/master/docs/tutorials/AddinTrouble.md
I was able to solve my problem.:) Thank you
from excelpython.
Excellent I am glad to hear it, thank you for your interest in the project!
Eric.
from excelpython.
Related Issues (20)
- Python NaN returns as 2.69e+308 HOT 1
- Error running macro in ImportPythonUDFs HOT 9
- Import Python UDF'S HOT 6
- Import Python UDFs not finding __xlfunc__ HOT 1
- add possibility to quit the com server HOT 5
- Handling very long arrays HOT 2
- Excel python future HOT 10
- Anyway to avoid needing the xlpython folder? HOT 3
- ExcelPython add-in HOT 1
- description of the arguments of an UDF HOT 1
- Memory error HOT 4
- Merged cell range
- ImportError: No module named 'numpy' HOT 1
- Run-time error '1000' HOT 1
- ActiveX component can't create object--everything dead! HOT 1
- ExcelPython installation issue HOT 1
- error while importing python UDF: wrong number of arguements or invalid propertyassignment.
- ExcelPython for Excel 2011 on Mac? HOT 2
- ExcelPython Installation HOT 1
- pywin32 error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from excelpython.