Hello,
We had made a macro in Office 2003 (PPT) which automatically generated rheological reports : taking pictures, reading log...
It used to work perfectly but now we have now installed Office 2010, when I launch the macro I get the following message : "Erreur : Argument ou appel de procédure incorrect"
I think that what doesn't work is this : (but maybe I am wrong?)
Synergy.StudyDoc.ExportAnalysisLog "C:\temp\MQR_output.txt"
'initialisaiton des variables
MsMat = ""
TempMat = 0
TempMold = 0
TTrans = 0
NbNode = 0
NbEle = 0
VolCanauxChaud = 0
VolCanauxFroid = 0
VolPart = 0
SectFront = 0
CommutTime = 0
CommutPourcentage = 0
InjTime = 0
CoolingTime = 0
EndPackingTime = 0
ClampMax = 0
ClampMaxTime = 0
PressureMax = 0
MsFileName = ""
fgHoldPres = 0
NbholdPres = -1
'HoldPourcentage = False
BNameTemp = ""
BStateTemp = False
NbreValveGate = 0
FillingPhase = False
fg = True
On Error GoTo ResumeNext
Trinp = FreeFile()
Open "C:\temp\MQR_Output.txt" For Binary As Trinp
If Not fg Then Exit Sub
MessOut = ""
lig = 0
While Not EOF(Trinp)
Get #Trinp, , A
Select Case A
The file "MQR_Output.txt" is not created in my Temp.
Do you see where this problem can come from? Are there "codes" in Moldflow 2013 that are not adapted to Office 2010?
Thanks in advance for your reply.
Hi,
can you try to break it up and add a back slash ("\") for path as such:
Set Synergy = CreateObject("synergy.Synergy")
Synergy.SetUnits "METRIC"
Set StudyDoc = Synergy.StudyDoc
StudyDoc.ExportAnalysisLog "C:\\temp\\MQR_output.txt"
Regards,
Berndt
Hi,
Thanks for your quick answer.
It still doesn't work with this solution...
The problem is only with the log ; I also aske in the code to create other types of files in my temp and it works:
(These are just abstracts)
'Export du model en udm :
Syn.Project.ExportModel "C:\temp\MQR_export.udm"
'lecture du fichier et remplacement des sauts de ligne :
numfichier = FreeFile()
Open "C:\temp\MQR_export.udm" For Binary As numfichier
Other example :
'Sauvegarde la vue :
Syn.Viewer.SaveImage "c:\temp\MQR_image_profil.gif"
Do you think it can be because it is a ".txt" file?
Hi,
I tested on my machine and it writes both .txt and .log in temp folder as expected.
Which release of Autodesk Simulation Moldflow do you use?
I test in Autodesk Simulation Moldflow Insight 2014 Service Pack 2.
Regards,
Berndt
Hi,
can you just try this piece of code, and run from command line or as macro?
SetLocale("en-us") Set Synergy = CreateObject("synergy.Synergy") Synergy.SetUnits "METRIC" Set StudyDoc = Synergy.StudyDoc StudyDoc.ExportAnalysisLog "C:\\temp\\analysis.txt"
It works fine on my machine.
Regards,
Berndt
Hi,
The release that I use is Moldflow Synergy 2013.
The piece of code you told me to test doesn't work either.
One of my colleagues has Moldflow 2014 installed on his machine.
I will test the macro on this release and see if it works better, as it is the case for you.
And if it doesn't, I will ask IT people's help in my company.
Thanks a lot for your help.
Hi,
I tested on a machine with Microsoft Office 2010 installed and
and with
Autodesk Simulation Moldflow Insight 2013 Service Pack 2
and
Autodesk Simulation Moldflow Insight 2014 Service Pack 2
The piece of code to write log to a file works as expected in 2013 and 2014 relase.
Regards,
Berndt
Can't find what you're looking for? Ask the community or share your knowledge.