AnsweredAssumed Answered

Extract data from excel spreadsheet and save it outside solidworks

Question asked by Gordon Rigg on Jan 12, 2021
Latest reply on Jan 12, 2021 by Artem Taturevych

First I have to ask if this is possible, then how to do it.

In my BOM some part numbers are of the form B_nnnn

These refer to my list of bin numbers which is an excel spreadsheet with 1500+ lines and constantly growing.

I already have a macro which finds those B_nnnn numbers in my BOM and creates a text file which is just a list of them, B_0001 B_0002 etc.

 

What I want to achieve is instead of just a list of the B numbers from my BOM, is to extract the line of data that B number has from an excel spreadsheet, and make a csv file with the B number data (suppliers part number, description and purchase data) in it listing only the B numbers in the bom, not all the other B numbers that I don't want my external supplier to see. Sending out the big spreadsheet is too much IP to send out the door.

 

I was thinking this might be easier if the first thing my macro did was open the bin number.xlsx spreadsheet and then save it as a CSV. Then maybe the macro can just delete every line that doesnt start with my identified short list of B numbers.
So far I have a macro that just opened the spreadsheet, cant find a way to then make it save it as CSV...

I'm miles away yet of course. Lots to learn.
It would be nice to have a reassurance it is actually possible before I waste a lot of time.

Maybe I cant control Excel from inside solidworks VBA like this.

Maybe a cant manipulate a csv from inside SW macro like this.

Outcomes