none
how to find .sqx file names present in the macro vb code of .xlsm file using open xml sdk RRS feed

  • Question

  • Hi,

    I want to find out .sqx files present in macro vb code of .xlsm file (i.e. MAcro enabled Excel file) using open xml sdk.

    I can read xlsm or excel files using open xml sdk now, but I am enable to reach to read the macros in the xlsm files.

    So please help me...!!!

    There will be some .sqx file names in the vb code of macro and I want to read it and return those sqx file names/ files.


    -- Prakash

    Monday, October 15, 2012 12:31 PM

Answers

  • Hi Forrest Guo,

    Thanks for your reply.

    This is very disappointing for me.

    But that's OK, man.

    I'll try in some another way, if possible. :)

    Thanks.

    --

    Prakash

    Tuesday, October 23, 2012 9:59 AM

All replies

  • Hi DotNetCoding,

    Thanks for posting in the MSDN Forum.

    As far as I know that Marc will be stored in vbaproject.bin file in every marco enabled document. And vbaproject.bin is a binary stream file. It is an open specification Promise -> http://download.microsoft.com/download/2/4/8/24862317-78f0-4c4b-b355-c7b2c1d997db/%5BMS-OVBA%5D.pdf. You can followed these to retrieve the information in the macro. And there have another useful link for vbaproject.bin in CODE PROJECT: http://www.codeproject.com/Articles/15216/Office-2007-bin-file-format I think it will help your on read vbaproject.bin.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, October 16, 2012 2:39 AM
    Moderator
  • thanks for your reply.

    can you please give me some code example to find out .sqx files list from vba (i.e. in Macro) in .xlsm file using openXML?

    Thanks in advance.


    -- Prakash

    Thursday, October 18, 2012 1:15 PM
  • Hi Prakash,

    I never tried it in Open XML project. I will try it the week end and I will come back next Monday.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, October 19, 2012 7:14 AM
    Moderator
  • Thanks a lot Tom.

    I am waiting for Monday. :)

    Have a nice week end.

    Friday, October 19, 2012 9:00 AM
  • Hi Prakash,

    I found something need to clarify. Would you please tell me where you stored your *.sqx file list? Is it in a variable in a vba module or a constant of the VBA project? I tried to scan the vbaproject.bin and I found that all variable will stored their name in a specific section, I think I need more information to test my idea.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us


    Monday, October 22, 2012 5:18 AM
    Moderator
  • Hi Tom,

    There will be path and name of .sqx files availbale in my vba code. For example, 

    Sub UpdBtn_Update1()
    Dim StarQuery As Object
        Set StarQuery = Application.COMAddIns("SymtraxStarQuery.ExcelAddin").Object
        StarQuery.RunTable "J:\Map files\1M.sqx"
    End Sub
    
    Sub UpdBtn_Update()
    Dim StarQuery As Object
        Set StarQuery = Application.COMAddIns("SymtraxStarQuery.ExcelAddin").Object
        StarQuery.RunTable "J:\Map files\1M.sqx"
    End Sub
    

    This is one example."1M.sqx" files I want to find out of this code and the total number file names I want to return.

    This code is on my some "Update button" present in the Excel file sheet. So in above code, there are two buttons, so these are two scripts available.

    --

    Prakash

    Monday, October 22, 2012 5:49 AM
  • Hi Prakash,

    OK, I will involve some experts into your issue to see whether them can help you out, and I will continue do research for it. There might be some time delay, thanks for you patience.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, October 23, 2012 6:30 AM
    Moderator
  • Hi Tom,

    Thanks a lot for your support.

    I hope we will get something smart solution on this. So I am eagerly waiting and also continuing my research on it.

    Thanks once again.

    --

    Prakash

    Tuesday, October 23, 2012 6:52 AM
  • Hi Prahash,

    I'm afraid we cannot provide OpenXml sample on this one. You may follow the first reply from Tom.

    regards


    Forrest Guo | MSDN Community Support | Feedback to manager

    Tuesday, October 23, 2012 9:51 AM
    Moderator
  • Hi Forrest Guo,

    Thanks for your reply.

    This is very disappointing for me.

    But that's OK, man.

    I'll try in some another way, if possible. :)

    Thanks.

    --

    Prakash

    Tuesday, October 23, 2012 9:59 AM