+ Reply to Thread
Results 1 to 14 of 14

Read binary data from non excel file and post in excel file

  1. #1
    Registered User
    Join Date
    12-29-2014
    Location
    Hyderabad ,India
    MS-Off Ver
    2007
    Posts
    6

    Read binary data from non excel file and post in excel file

    I am Trying to read data as Bytes from a non Excel File by opening it as Binary and write the same data in Bytes in an excel file through the following VB Program.I am able to Read Successfully from the non Excel file but the data read in Bytes is not getting posted in the Sheet4(Not the Active Sheet) of the Currently Active Excel workbook.I will be thankful if any body help me in this regard.please note that i am new to EXCEL VBA.

    Please Login or Register  to view this content.
    Last edited by Leith Ross; 12-29-2014 at 08:55 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Read binary data from non excel file and post in excel file

    but the data read in Bytes is not getting posted in the Sheet4(Not the Active Sheet)
    Maybe I still have a little Christmas lag - but it might help it you explained a little more clearly.

    (Other people may read that differently - I read it as not getting posted on Sheet4 and not getting posted on the active sheet - it's ambiguous)
    Last edited by cytop; 12-29-2014 at 04:48 AM.

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Read binary data from non excel file and post in excel file

    hi D S Rama Rao, welcome to Excelforum, you should use special tags when posting any code on the forum (as did I). Try sort of that:

    Please Login or Register  to view this content.
    Last edited by watersev; 12-29-2014 at 07:01 AM.

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Read binary data from non excel file and post in excel file

    please test it on your data

  5. #5
    Registered User
    Join Date
    12-29-2014
    Location
    Hyderabad ,India
    MS-Off Ver
    2007
    Posts
    6

    Re: Read binary data from non excel file and post in excel file

    Thanks for reply.
    The Variable filepath is in cell($A$1)of Sheet1 and function is in cell($B$1)of Sheet1 of the same workbook.
    However i want the data to be posted on sheet4 in cell($A$1)of the same workbook.That is what i ment.

    Hope I made it clear

  6. #6
    Registered User
    Join Date
    12-29-2014
    Location
    Hyderabad ,India
    MS-Off Ver
    2007
    Posts
    6

    Re: Read binary data from non excel file and post in excel file

    Dear sir,

    Thanks for the reply.

    In-spite of altering my code as per your advise,nothing is posted in Sheet4.

    I am not able to understand what is my mistake.

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Read binary data from non excel file and post in excel file

    try this then:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-29-2014
    Location
    Hyderabad ,India
    MS-Off Ver
    2007
    Posts
    6

    Re: Read binary data from non excel file and post in excel file

    Dear WaterSev Guru,
    Thanks for your prompt reply.
    The introduction of "temp" has not improved the Performance of code.
    I have Introduced a message box inside the "for" loop and found out that the loop is performing well. ie.,bytes are
    read correctly and the value of each Byte is assigned correctly to the array Byet
    The code "Sheets("Sheet4").Range("a1"). Resize (,I - 1)=Byet" is not performing.
    Any Idea where i have gone wrong?

  9. #9
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Read binary data from non excel file and post in excel file

    I suppose the sheet named "Sheet4" is not existing. I do not see any other reason for the issue.

  10. #10
    Registered User
    Join Date
    12-29-2014
    Location
    Hyderabad ,India
    MS-Off Ver
    2007
    Posts
    6

    Re: Read binary data from non excel file and post in excel file

    Dear WaterSev Guru,

    Thanks for your prompt reply.

    The Sheet Named "Sheet4" is in fact existing.

    Am i missing any other thing ?.

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,240

    Re: Read binary data from non excel file and post in excel file

    Quote Originally Posted by D S Rama Rao View Post
    I am Trying to read data as Bytes from a non Excel File by opening it as Binary....
    Please take the time to review our rules. There aren't many, and they are all important.

    You have cross-posted this at least 4 times (one example at http://help.howproblemsolution.com/1...-in-excel-file)

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  12. #12
    Registered User
    Join Date
    12-29-2014
    Location
    Hyderabad ,India
    MS-Off Ver
    2007
    Posts
    6

    Re: Read binary data from non excel file and post in excel file

    Dear sir,

    I have first posted this in Excelguru on 28.12.2014,and finding that i did not get any help from that forum i have posted the same in ExcelHelp Forum on 29.12.2014.However immediately after posting in Excel Help Forum i read the rules of the forum and refrained to post in the other forums.I have no idea how it has been and who posted the same in HPS and till now i do not know in what other forum it is posted. I sicerely regret for floating of your rules in the first instance.I am a retired and aged person of 75 years old and recently started learning to operate computers and software.Kindly treat me as a person who learns lessons usually after commiting mistakes and not before. Hope you will understand.

  13. #13
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,240

    Re: Read binary data from non excel file and post in excel file

    It is acceptable to post the same question to other forums, but you must notify us in your post that you have done so. No harm done. Good luck in solving your problem.

  14. #14
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Read binary data from non excel file and post in excel file

    the code from post #2 would work in conjunction with a subroutine that would pass file path to the function.

    In order for the function (UDF) to give result on the sheet it should be changed this way:

    Please Login or Register  to view this content.
    PS. It's an array function so must be confirmed with CTRL+SHIFT+ENTER
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to speed up binary file read?
    By XmisterIS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2014, 11:39 AM
  2. Importing a Binary File, displaying as Hex, and saving the file as a Binary file again
    By bluenose616 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-26-2014, 04:46 PM
  3. read value of strings from a text file and make an excel file.
    By gashforing in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2009, 07:12 AM
  4. Replies: 2
    Last Post: 12-12-2005, 02:35 PM
  5. read a Unix binary file
    By Arnaud Boëlle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2005, 05:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1