Results 1 to 9 of 9

Invalid or unqualified reference error when inserting a formula into a cell via VBA

Threaded View

AnthonyWB Invalid or unqualified... 05-10-2010, 03:03 PM
DonkeyOte Re: Invalid or unqualified... 05-10-2010, 04:50 PM
AnthonyWB Re: Invalid or unqualified... 05-10-2010, 05:07 PM
DonkeyOte Re: Invalid or unqualified... 05-10-2010, 05:44 PM
AnthonyWB Re: Invalid or unqualified... 05-11-2010, 09:45 AM
romperstomper Re: Invalid or unqualified... 05-11-2010, 09:47 AM
AnthonyWB Re: Invalid or unqualified... 05-11-2010, 09:49 AM
romperstomper Re: Invalid or unqualified... 05-11-2010, 09:52 AM
AnthonyWB Re: Invalid or unqualified... 05-11-2010, 10:06 AM
  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Invalid or unqualified reference error when inserting a formula into a cell via VBA

    Hello everyone. I am attampting to insert the following formula into a cell:

    sum('[Client_Operations.xlsm]Client_Operations_Details'!$L$2:$L$500)
    I am using the code below to do this, and I am receiving an "invalid or unqualified reference" error.

    Sub Calculate_157_Disclosures()
        Dim sPath1      As String
        Const sFileInp1 As String = "157_Disclosure.xlsm"
        Const sFileInp2 As String = "Client_Operation.xlsm"
        Dim wb1         As Workbook
        Dim wb2         As Workbook
        
        sPath1 = fPath & fDate & "_157\157_Reports\IBRD_Disclosure\"
          
        Set wb1 = Workbooks.Open(sPath1 & sFileInp1)
        Set wb2 = Workbooks.Open(sPath1 & sFileInp2)
        
        .Range("I14").Formula = "=sum('[Client_Operations.xlsm]Client_Operations_Details'!$L$2:$L$500)"
        
        wb1.Close SaveChanges:=True
        wb2.Close SaveChanges:=True
       
    End Sub
    Any suggestion on what is going wrong?
    Last edited by AnthonyWB; 05-11-2010 at 10:07 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1