• 易迪拓培训,专注于微波、射频、天线设计工程师的培养
首页 > CST > CST使用问答 > 用EXCEL来控制CST 运行,出错了,怎么回事?

用EXCEL来控制CST 运行,出错了,怎么回事?

录入:edatop.com     点击:
参照example里提供的demo例子,自己试着写了一个:模型结构已经在CST里建好,主要是想修改激励源,来控制CST仿真。VBA语言如下:
Option Explicit
Sub mwsconnect()
' Next open a connection to CST DESIGN ENVIRONMENT
Dim studio As Object
Set studio = CreateObject("CSTStudio.Application")
' Now open the model file which is located in the same folder as the Excel sheet
' This will also return a connection to CST MICROWAVE STUDIO
Dim path As String
Dim fname As String
path = ActiveWorkbook.path
Dim mws As Object
Set mws = studio.OpenFile(path & "\lojiedigis1MHz_sinExcition.cst")
mws.DeleteResults
With mws.TimeSignal
     .Reset
     .Name "default"
     .SignalType "Sine step"
     .ProblemType "High Frequency"
     .Ttotal "2"
     .Phase "0.0"
     .Frequency "1"
     .RiseFactor "0.0001"
     .Create
End With
mws.Rebuild
' Make a connection to the solver and start the simulation
mws.solver.Start
mws.Save
' Finally close the connection to CST MICROWAVE STUDIO
studio.Quit
Set studio = Nothing
End Sub
但是EXCEL 提示未找到文件!现在CST提供的demo例子也不知道被我改了什么也提示这个错误。上面的VBA有错吗?还有那个EXCEL提示未找到文件是原因啊?谢谢!
还有在按EXCEL里的VBA保存时,经常提示如下错误。这是为什么啊?谢谢!


申明网友回复良莠不齐,仅供参考。如需专业解答,请学习易迪拓培训专家讲授的CST视频培训教程

上一篇:CST帮助文件中文版
下一篇:问下,CST中边界open, open-addspace,peroidic,unit-cell这几个边界条件有啥区别?

CST培训课程推荐详情>>

  网站地图