用EXCEL来控制CST 运行,出错了,怎么回事?
05-08
参照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保存时,经常提示如下错误。这是为什么啊?谢谢!
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保存时,经常提示如下错误。这是为什么啊?谢谢!
相关文章:
- 问个2006的本振模求解控制器的问题 (05-08)
- 请问如何用C#控制CST进行仿真? (05-08)
- 请问CST MWS中如何用VBA控制parameter list中的参数? (05-08)
- CST仿真控制器的EMC (05-08)
- 关于CST MWS脉冲激励的时长控制 (05-08)
- 远程控制中遇到的问题 (05-08)
射频专业培训教程推荐