none
SELECT A WORK SHEET IN VISUAL STUDIO RRS feed

  • Question

  • Hi

    how i can select a work sheet in visual studio by VBA Code? 

    in VBa in excel i can select a sheet by

    sheets(1).range("A1").select

    but thise code in V.S. this code note True?

    why????????

    Wednesday, October 24, 2018 7:56 AM

All replies

  • Hi mahdi.v,

    Welcome to the MSDN forum.

    It seems your issue is about Excel development, since our forum is to discuss the VS IDE, I will help you move this thread to the appropriate forum for a better support, thank you for your understanding.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, October 25, 2018 2:26 AM
  • Hi mahdi.v,

    >> how i can select a work sheet in visual studio by VBA Code? 

    If you want to select a work sheet in visual studio by VBA Code, you can call VBA code from Office solutions created by using Visual Studio:

    Call code in VSTO Add-ins from other Office Solutions

    Combine VBA and document-level customizations

    Or you can try to use the following code to select a worksheet in C#:

    ((Excel.Worksheet)this.Application.ActiveWorkbook.Sheets[1]).Select();

    For more information, please review the following link:

    How to: Programmatically select worksheets

    Also, if possible, I think you could use the VSTO to create your Office Add-in.

    Hopefully it helps you.

    Best Regards,

    Yuki


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.


    Thursday, October 25, 2018 2:38 AM
    Moderator
  • Hi mahadi.v,

    Thanks for your asking. Did you resolve your issue? If the post helps you, you can mark it as answer and close the post.

    Thank you for understanding. If you have any question, or update, please feel free to let us know.

    I wish you a happy life!

    Best Regards,

    Yuki


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Friday, October 26, 2018 8:18 AM
    Moderator