Open Excel without displaying the workbook

decoalaa Posted messages 18 Status Member -  
Polux31 Posted messages 7219 Status Member -
Hello,
I need to use Excel in a data comparison tool, and actually I want to execute it but without displaying the workbook, because I want to use it from an interface but without seeing the Excel page.
Does anyone have an idea, please?
Configuration: Windows XP Firefox 3.0.3

18 answers

  1. decoalaa Posted messages 18 Status Member 13
     
    Thank you for your response, but actually I don't quite see how we can do this with this connection.
    Can you explain it to me a bit please?
    Thanks in advance.
    3
  2. Polux31 Posted messages 7219 Status Member 1 204
     
    Hello,

    We can work in a closed Excel workbook using an ADO connection to the workbook.

    ;o)
    --
    “What is well conceived is clearly stated, And the words to say it come easily.”
    Nicolas Boileau
    1
  3. decoalaa Posted messages 18 Status Member 13
     
    OK, but in the link, it talks about a closed file, and in my workbook, I have Macros. Wouldn't that be a problem since the macros only run with an open file?
    1
  4. lermite222 Posted messages 9042 Status Contributor 1 199
     
    Hello to both of you,
    For what you want to do, there's a simpler solution: just after opening it, make it hidden

    Example:
    Workbooks.Open Path & ""Workbook1.xls"

    Windows("Workbook1.xls").Visible=False
    See you!
    --
    Experience teaches more surely than advice. (André Gide)
    If you bump into a pot and it sounds hollow, it doesn't necessarily mean the pot is empty. ;-)(Confucius)
    1
    1. Polux31 Posted messages 7219 Status Member 1 204
       
      Hi hermit,

      I’m having a hard time digesting today. It is indeed the right method.

      ;o)
      --
      “What we conceive well is clearly stated, And the words to express it come easily.”
      Nicolas Boileau
      0
  5. decoalaa Posted messages 18 Status Member 13
     
    Hello hermit,
    I believe this is the right method, but since I'm not very proficient in Excel, I wanted to know where exactly these command lines should be placed? In the workbook?
    1
  6. decoalaa Posted messages 18 Status Member 13
     
    Actually, it's all good, I found how to do it, but the problem now is that I can't edit it to modify it since it's now hidden.
    1
  7. Polux31 Posted messages 7219 Status Member 1 204
     
    To see it, you need to set the Visible property to True instead of False

    ;o)
    --
    “What is well conceived is clearly stated, and the words to say it easily come.”
    Nicolas Boileau
    1
  8. decoalaa Posted messages 18 Status Member 13
     
    Thank you very much for your help.
    1
  9. decoalaa Posted messages 18 Status Member 13
     
    In fact, there is always a problem; now that it is hidden, I can only open it in read mode, and as a result, I can't modify it to change false to true.
    1
  10. Polux31 Posted messages 7219 Status Member 1 204
     
    It must be done from the application that controls the hidden file.

    ;o)
    --
    “What one clearly conceives, one can state clearly, and the words to say it come easily.”
    Nicolas Boileau
    1
  11. decoalaa Posted messages 18 Status Member 13
     
    I don't really see what you mean, what is the application you're talking about?
    1
  12. Polux31 Posted messages 7219 Status Member 1 204
     
    I need to use Excel in a data comparison tool

    I imagine it's the comparison tool, otherwise what would be the point of opening and hiding an Excel file???

    ;o)
    --
    «What is well conceived is clearly stated, And the words to say it come easily.»
    Nicolas Boileau
    1
  13. decoalaa Posted messages 18 Status Member 13
     
    Well yes, but the tool does not contain the Macro code; the tool only calls the Excel sheet which takes care of retrieving data and providing it for further processing.
    So the Macro code only exists in the Excel file, and if I can't open it (because it is hidden), I can't modify it.
    1
  14. Polux31 Posted messages 7219 Status Member 1 204
     
    What is the tool?

    If it can open an Excel file, it should be able to hide it, make it visible, and run the macro, etc.

    ;o)
    --
    “What we conceive well is clearly stated, and the words to say it come easily.”
    Nicolas Boileau
    1
  15. decoalaa Posted messages 18 Status Member 13
     
    It's good, thanks, I found out how to do it; you just need to raise the security level and then disable macros, that allows you to modify them afterwards.
    Thanks for your help.
    1
  16. Polux31 Posted messages 7219 Status Member 1 204
     
    You're welcome

    Good luck

    ;o)
    --
    “What is well conceived is clearly stated, and the words to say it come easily.”
    Nicolas Boileau
    1
  17. Polux31 Posted messages 7219 Status Member 1 204
     
    Indeed, this method doesn't work :o|

    --
    "What is well conceived can be clearly stated, and the words to say it come easily."
    Nicolas Boileau
    0