Reputation: 1
I am trying to run the below code (currently have JMP12, Python3). But this is giving an error saying doc variable is none type. If this method doesnt work, please suggest if there is any other method to use to convert JMP file into a CSV file for further python processing.
Tried to close all JMP windows and run it. Didnt help.
import pandas as pd
from win32com.client import Dispatch
jmp = Dispatch("JMP.Application")
doc = jmp.OpenDocument('test.jmp')
doc.SaveAs('sasjmpfile.csv')
df = pd.read_csv('sasjmpfile.csv')
Basically data is not loading into python.
AttributeError: 'NoneType' object has no attribute 'SaveAs'
Upvotes: 0
Views: 2965
Reputation: 49
This simply indicates, that the file "test.jmp" wasn't found. A file that wasn't found can't be saved consequently. Please try again giving the entire path , e.g:
doc = jmp.OpenDocument('C:/my_folder/my_subfolder/test.jmp')
Upvotes: 0