Results 1 to 9 of 9

Thread: Opening a VSTO Excel Cusomization Via Intranet

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Opening a VSTO Excel Cusomization Via Intranet

    We have a few reports on a network drive which have links pointing to them on the intranet.

    I would like to pass a parameter from the link to the Excel Startup method so the excel workbook can respond based on the parameter value.

    Is it possible to pass a parameter (start up value) to excel when opening just via a link?

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Opening a VSTO Excel Cusomization Via Intranet

    I not sure if I will be of much help but let me try.... What parameters are we looking at?
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Opening a VSTO Excel Cusomization Via Intranet

    Is it possible to pass a parameter (start up value) to excel when opening just via a link?
    you could do this in the workbook open event,

    or use some scripting to get the value and pass to the call to open the workbook, using shell command
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  4. #4

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: Opening a VSTO Excel Cusomization Via Intranet

    Well im pretty sure you can pass openh args from a shell command to normal excel workbooks.

    However in this instance I would like figure a way to do it with no script on the calling side.

    I basically need (if possible) from a list of hyperlinks on the intranet which display customer numbers the user to be able to click on a link which points at copy of the xlsm on the network, this seems to open an instance of the customisation fine. However at the same time I could do with it passing through the customer number as a parameter so when the workbook loads (it is a report) It can look up the customer data from the database.

  5. #5
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Opening a VSTO Excel Cusomization Via Intranet

    Then in that case I would suggest you to point that link to a vbs file.

    The vbs file will prompt for the customer number and then open the workbook to take the necessary actions...
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  6. #6

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: Opening a VSTO Excel Cusomization Via Intranet

    I dont really want to prompt though, if I did point the link at a vbs file could it automatically pass the parameter value as in a URL parameter and the VBS file parse it. The idea is that the user just clicks on the link and the report automatically loads up with the correct data with no further interaction (except for clicking ok on the open file dialog of course).

  7. #7
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Opening a VSTO Excel Cusomization Via Intranet

    Then how will it feed the 'Customer Number'? or do you want to pre-feed the number in the link?
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  8. #8

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: Opening a VSTO Excel Cusomization Via Intranet

    Thats what I was hoping, I was hoping there may be a way to pass it like a parameter in a URL string?

  9. #9
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Opening a VSTO Excel Cusomization Via Intranet

    you can pass a parameter before the filename, using shell or shellexecute

    you need apis to get the passed argument(s)

    see http://www.motobit.com/tips/detpg_vba-getcommandline/
    for the API code, i tested works good

    then pass a command like
    Shell """" & Application.Path & "\excel.exe"" /xx/ " & """C:\Users\Public\Book103.xls""", vbNormalNoFocus

    where xx is your parameters, you can separate with more /, but no spaces in parameters
    then parse out from the full command line
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

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



Click Here to Expand Forum to Full Width