Forum Discussion

Neil ...'s avatar
Neil ...
Copper Contributor
Feb 01, 2018

Open a path to a server from within excel

Hi, fundamentally I'm having a problem with opening a path to a printer server address

 

\\srv-print\prn0000

 

If i make this a hyperlink and klick it in word, outlook, or put it in to the URL/address bar of file explorer it makes sure i want to open it and then proceeds to install the printer.

 

In excel I get an error, it says something like it cant open the specified file (I'm working in a Swedish version of office)

I've tried also file:///\\srv-print\prn0000 and that doesnt work either.

How do I format it so that it works?

3 Replies

    • Neil ...'s avatar
      Neil ...
      Copper Contributor

      Hi, that doenst work either for some reason it causes excel to become unresponsive and after a while it returns control, but nothing happens other than it locking up for a bit. :(

      • JKPieterse's avatar
        JKPieterse
        Silver Contributor

        In that case I guess all I can think of is using a bit of VBA to do this.

        Option Explicit
        
        Sub OpenLinkUsingWord(sLink As String)
            With CreateObject("Word.Application")
                With .documents.Add
                    .FollowHyperlink sLink
                    .Close False
                End With
                .Quit
            End With
        End Sub
        Sub Demo()
            OpenLinkUsingWord "http://jkp-ads.com"
        End Sub

Resources