Copy object from clipboard to file
-
While using Excel, I imported text file as an object (imported as OLEObject). I want to export it back to a text file. I can copy it to the clipboard, but I don't know how to copy it from the clipboard to a path.
-
While using Excel, I imported text file as an object (imported as OLEObject). I want to export it back to a text file. I can copy it to the clipboard, but I don't know how to copy it from the clipboard to a path.
Wouldn't it be alot easier to tell Excel to export the information back to a text file using the SaveAs function? You'd save yourself the work of writing code to go to the clipboard and import the Excel sheet data that's on it (not text!), parse it up to get the text and then write it out to a file. RageInTheMachine9532
-
Wouldn't it be alot easier to tell Excel to export the information back to a text file using the SaveAs function? You'd save yourself the work of writing code to go to the clipboard and import the Excel sheet data that's on it (not text!), parse it up to get the text and then write it out to a file. RageInTheMachine9532
I checked this option, but it seems that I can't use SaveAs function for OLEObject. Can you write me the code lines of how to save OLEObject (that contains one item - which is text file) to text file? Thanks
-
I checked this option, but it seems that I can't use SaveAs function for OLEObject. Can you write me the code lines of how to save OLEObject (that contains one item - which is text file) to text file? Thanks
I think I misunderstood you before. Your saying that you imported the text file and kept it an OBJECT in the worksheet? You did NOT import the text into the worksheet? If that's the case, could you import the text as text, not an object, onto a newly created blank worksheet, then use SaveAs on the worksheet object? RageInTheMachine9532
-
I think I misunderstood you before. Your saying that you imported the text file and kept it an OBJECT in the worksheet? You did NOT import the text into the worksheet? If that's the case, could you import the text as text, not an object, onto a newly created blank worksheet, then use SaveAs on the worksheet object? RageInTheMachine9532
-
I imported the data as an object, since the data file has more lines than the sheet. Hence, importing the data into blank sheet will not be good.
OK. Now I'm a little confused... Are you saying that the text your importing is NOT integrated into the worksheet data? Or are you scanning the data yourself and importing sections of it? Now, are you putting the modified worksheet data back into the text file? Or are you putting the original text file back on the clipboard from Excel and treating the text file something like an email attachment? RageInTheMachine9532
-
OK. Now I'm a little confused... Are you saying that the text your importing is NOT integrated into the worksheet data? Or are you scanning the data yourself and importing sections of it? Now, are you putting the modified worksheet data back into the text file? Or are you putting the original text file back on the clipboard from Excel and treating the text file something like an email attachment? RageInTheMachine9532
I have a big text file (standalone). I want to analyze the data in it. In order to analyze it, I need MS Excel. I wrote a macro that reads the data from the text file into array, analyze the data and at the end import the text file as an OLE Object (from Menu bar I Choose Insert, then Object and then the file name). I can't paste the text file to sheet, since the number of lines is text file is bigger than the max number of lines in Excel sheet. Then I save the Excel file. I have a sheet that contains an object in it. I send this Excel file. Now, I assume that I get the Excel file. I open the saved file. I want to analyze only part part of the data. I need to read the text file into the array. The text file is located in the sheet, and I don'd know how to read data from it. If I will copy this text file outside of the Excel, I will know how to read it. I need the code to copy this textfile outside of the excel. (I succedded to copy the text file to the clipboard, but not from the clipboard to the desired directory. Thanks
-
I have a big text file (standalone). I want to analyze the data in it. In order to analyze it, I need MS Excel. I wrote a macro that reads the data from the text file into array, analyze the data and at the end import the text file as an OLE Object (from Menu bar I Choose Insert, then Object and then the file name). I can't paste the text file to sheet, since the number of lines is text file is bigger than the max number of lines in Excel sheet. Then I save the Excel file. I have a sheet that contains an object in it. I send this Excel file. Now, I assume that I get the Excel file. I open the saved file. I want to analyze only part part of the data. I need to read the text file into the array. The text file is located in the sheet, and I don'd know how to read data from it. If I will copy this text file outside of the Excel, I will know how to read it. I need the code to copy this textfile outside of the excel. (I succedded to copy the text file to the clipboard, but not from the clipboard to the desired directory. Thanks
Well, I've found out the you can't programatically get to what you want to do. In order to save the object back to a text file, you have to righ click the object icon, select Package Object, then Edit Package. A new window will open up called "Object Packager". From here you can select File|Save Contents to resave the text file back to an actual file. The problem is, you can't programatically control the Object Packager. I think you'd be better off importing the text into a second worksheet in the same workbook, but you'd have to do the importing yourself, one row for each line of the file and when you run out of rows, go to the next column and go down the rows again, and repeats this until you run out of text file. Then, you can write another macro to do the same thing, but write out the text instead of reading it. But, the bottom line seems to be keep the files seperate and have Excel import the data you need when you need it. RageInTheMachine9532
-
Well, I've found out the you can't programatically get to what you want to do. In order to save the object back to a text file, you have to righ click the object icon, select Package Object, then Edit Package. A new window will open up called "Object Packager". From here you can select File|Save Contents to resave the text file back to an actual file. The problem is, you can't programatically control the Object Packager. I think you'd be better off importing the text into a second worksheet in the same workbook, but you'd have to do the importing yourself, one row for each line of the file and when you run out of rows, go to the next column and go down the rows again, and repeats this until you run out of text file. Then, you can write another macro to do the same thing, but write out the text instead of reading it. But, the bottom line seems to be keep the files seperate and have Excel import the data you need when you need it. RageInTheMachine9532
Thanks