Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Using VBA commands to insert blank rows between data
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Meaghan

Posts: 3
Registered: 5/28/13
Using VBA commands to insert blank rows between data
Posted: Aug 4, 2013 12:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi there,

I'm trying to get Matlab to function through actxserver and then insert a variable number of rows between other data in the spreadsheet.

So far I have been able to make it delete data that has been found:

*productfile and item_selected are defined in another GUI and stored with set/getappdata and recalled to the program successfully
*editrange is a variable that is calculated after the program uses regexp to find data that matches what the user has entered; it is the length of the data that need to be deleted


excel = actxserver('Excel.Application')
Workbook = excel.Workbooks.Open(productfile)
Sheet = get(excel.sheets, 'item', item_selected)
Sheet. Activate
ran = excel.Activesheet.get('Range', editrange)
del = ran.Delete
invoke(Workbook, 'SaveAs', productfile)
invoke(excel, 'Quit')
delete(excel)

This all works fine, the problem appears when I now need to insert new data, from another file. This data is not guaranteed to be of the same size, so I planned to first insert the calculated number of new rows, then xlswrite to them.

thanks!



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.