Results 1 to 7 of 7

Thread: SAS add in Advanced VBA question

  1. #1
    VBAX Regular
    Joined
    Sep 2013
    Posts
    37
    Location

    SAS add in Advanced VBA question

    Hello,

    I am trying to figure out how to call a stored process flow from SAS usingvba. I found some information Online... here is my code.
    Sub InsertSasDataSet()
      Dim sas As SASExcelAddIn
      Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
     sas.InsertStoredProcess "P:\HumanDev\QA\Staff\REPORT SPECIALIST\James Mutscheller\My Reports\Weekly\HD\Conversions.egp", Sheet1.Range("A1")
     
      End Sub
    I get the error Run time error '-2146233086 (80131502)':
    Length cannot be less than zero
    Parameter name: length

    any help would be greatly appreciated.

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,954
    Location
    Did you set the object in Tools > References?

    Step through the code by F8 to see which line of code it errors on.

  3. #3
    VBAX Regular
    Joined
    Sep 2013
    Posts
    37
    Location
    Yes I did. Error on line 3

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,954
    Location
    You should have seen that error before running when you compile the program. If you are not using the Debug menu's Compile before running code, I recommend doing that. As I explained, that would indicate that you have not set the SAS reference.

    This explains what I am talking about. http://scienceofanalytics.com/2013/0...s-auto-part-1/
    Last edited by Kenneth Hobs; 01-16-2014 at 12:49 PM.

  5. #5
    VBAX Regular
    Joined
    Sep 2013
    Posts
    37
    Location
    I'v read that and I had already done as i said before. I know Google is a great tool but this is pretty specialized stuff. I have the 4.3 add I'm and i checked the box for it. It's not a terrible thing if i can't make it work, but if I can it will take my programming to the next level.

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    Did you Trust access to the VBA project object model?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    snb
    Guest
    did you check

    sub tst()
       msgbox dir("P:\HumanDev\QA\Staff\REPORT SPECIALIST\James Mutscheller\My Reports\Weekly\HD\Conversions.egp" 
    End Sub
    and
    sub tst()
       getobject("P:\HumanDev\QA\Staff\REPORT SPECIALIST\James Mutscheller\My Reports\Weekly\HD\Conversions.egp").application.visible=true
    End Sub

Posting Permissions

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