[Excel + VBA + SharePoint] Run-Time Error when opening Excel file from SharePoint page RRS feed

  • Question

  • Hi there,

    I have workbook structured as follow:

     - sheet1: - contain an overview template of a selected product

                     - Form button with a macro assigned

                     - the macro open a userform

                     - the userform use SQL modules to filter data in a combobox and list box

                     - validate button that copy data from list box to sheet1

     - sheet2: contain data and endless columns and rows

    The problem is, each time I copy this file to a SharePoint page then open it I receive this message:

    Run-Time Error '-2147467259 (80004005)' Internet Address not valid

    How can I fix it, knowing it works fine on a local and virtual drive, please?

    Friday, October 5, 2012 3:46 PM

All replies

  • Hi Admin-Dev,

    Thanks for posting in the MSDN Forum.

    Would  you please show me some code snippet for further research?

    Have a good day,


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

    Monday, October 8, 2012 4:07 AM
  • Hi Tom,

    I have a button in a worksheet, linked to a macro that will enable a module that contain this code:

    Option Explicit
    Sub btnForm()
    End Sub

    This code will open a UserForm

    The error runtime pinpoint to this code.


    Monday, October 8, 2012 4:59 PM
  • @Admin-Dev,

    The VBE debugger not always show the line where you got the runtime error.

    In order to really know the line where you get the error, please execute this subprocedure pressing F8 key instead of F5 and let us know where you get the error.

    Felipe Costa Gualberto -

    Monday, October 8, 2012 11:42 PM
  • Hi Admin-Dev

    I think you need provide more detailed code snippet for further research.

    The first thing which I feel is the initialization function of frmForm1. whether there have exception? Second, whether you invoke the classe frmForm1 form correct path.

    Have a good day,


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

    Friday, October 12, 2012 7:02 AM
  • Hi,

    this code start when you open the workbook, so I cannot use F8 or F5.

    again the issue is perplex:

     - when I open the file from my hard drive, virtual drive or email it works fine

     - when I upload the file to a SharePoint website and then execute the file I get this error


    Sunday, October 21, 2012 4:50 PM
  • Hi Admin-Dev,

    The exception id seems a OLE DB error id there. Would you double check your connection?

    Have a good day,


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

    Monday, October 22, 2012 5:44 AM
  • Hi,

    I'm used to upload/download files from this SharePoint page all the time, it's just with this file (VBA included that I have issues)


    Tuesday, October 23, 2012 7:41 PM
  • Hello,

    This article may help you research your underlying issue:

    Additionally, as the issue does not appear to be a problem with the code using Excel itself locally, I suggest you post your question to the SharePoint DEV Forum resources that may be better able to assist you with using the code in that specific technology. I'm providing the overall list of the Forums as they have specific forums for the different versions.

    Thank you,


    Wednesday, October 24, 2012 3:09 PM