Don't ask to ask, just ask | |
PerlMonks |
Re^6: Win32::OLE Excel search and replace commasby generator (Pilgrim) |
on Nov 14, 2010 at 02:51 UTC ( [id://871270]=note: print w/replies, xml ) | Need Help?? |
(John) Davies, Thanks for the suggested sources. I have collected and recorded the FileFormat codes after converting them as you suggested. I was also pleased with the link you provided that finally allowed me to understand how a VB "Macro" within Excel could be converted to Win32::OLE directives. Clearly your googling yielded better results than mine. The relative file path/name issue was a little challenging. (My plan is to compile this script with Active State's PDK and let the user put the program in any directory they choose along with the source excel files.) I found that the method use to indicate "currently logged directory" in the file grep command would not work similarly within the Win32::OLE statements.I settled on using Win32::OLE's GetFullPathName call to pull the full path hoping it would work better than the ./ prefix used for discoverng the excel files. The $Book SaveAs Filename gave me some headeaches because one of my source files had spaces in the name. I tried applying quote marks around the pathname/filename without success. Eventually I settled for stripping out the spaces in the name before writing the file back as a CSV. I wasn't able to get your program to work, but am fairly satisfied with the current state of mine. Again thanks for the answers. I'm feeling a whole lot better about the future opportunities to convert excel spreadsheets to usable data import files.
<>< generator
In Section
Seekers of Perl Wisdom
|
|