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?)
'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.
can you try to break it up and add a back slash ("\") for path as such:
Set Synergy = CreateObject("synergy.Synergy")
Set StudyDoc = Synergy.StudyDoc
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 :
'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 :
Do you think it can be because it is a ".txt" file?
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.
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.
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.
I tested on a machine with Microsoft Office 2010 installed and
Autodesk Simulation Moldflow Insight 2013 Service Pack 2
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.