I am having a problem with a vbscript running an excel macro. The goal here is to have the script run a macro which imports a CSV file into a user's currently open workbook. Here is my code:
Set oExcel = GetObject(,"Excel.Application")
oExcel.Run "ImportCSV" 'runs the macro ImportCSV
oExcel.UserControl = True
set oExcel = nothing
The script does what it's supposed to do but it causes Excel to freeze. I have to use the Task Manager to close Excel. When I reopen the workbook that froze, the csv has been imported correctly (and it apparently saved it automatically). So I just need something to keep Excel from freezing. I think it has something to do with vbscript taking control of the open workbook then being unable to relinquish control. Any ideas?
Set oExcel = GetObject(,"Excel.Application")
oExcel.Run "ImportCSV" 'runs the macro ImportCSV
oExcel.UserControl = True
set oExcel = nothing
The script does what it's supposed to do but it causes Excel to freeze. I have to use the Task Manager to close Excel. When I reopen the workbook that froze, the csv has been imported correctly (and it apparently saved it automatically). So I just need something to keep Excel from freezing. I think it has something to do with vbscript taking control of the open workbook then being unable to relinquish control. Any ideas?