The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

Advanced Search

Back to Topic List Back to Topic List  

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')

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.


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.