Results 1 to 6 of 6

Thread: Auto_Open sub gives errors after upgrade from excel 2000 to 2003

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    3

    Auto_Open sub gives errors after upgrade from excel 2000 to 2003

    Compile Error, cannot find project or library.

    Any help on what's happening here? Code worked in Excel 2000

    Thank you

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Auto_Open sub gives errors after upgrade from excel 2000 to 2003

    It should highlight a line or at least move to it...
    Whats on that line...? Is it in the references (F2 for object list)
    Do you have all the references in (newer ones for excel objects ofcourse).?

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    3

    Re: Auto_Open sub gives errors after upgrade from excel 2000 to 2003

    Here is the code:

    Sub Auto_Open()
    a = InputBox("enter file name", "File to Import")
    Workbooks.OpenText Filename:= _
    a, Origin:=xlWindows, _
    StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(0, 1)
    Cells.Select
    Selection.Cut
    Windows("lonestar.xls").Activate
    Sheets(1).Select
    Range("A1").Select
    ActiveSheet.Paste
    i = 2
    j = 2
    k = 2
    z = k
    b = k
    Do Until Cells(i, 1).Value = ""
    If Left(Cells(i, 1), 2) = "11" Then
    'asked to change on 3/3 by barbara from healthmatics
    'Sheets(2).Cells(k, 4).Value = "'" & Mid(Cells(i, 1).Value, 3, 20)
    'asked to change on 3/3 by barbara from healthmatics
    ' added 2/17 per healthmatics request
    'Sheets(6).Cells(j + 1, 1).Value = Sheets(2).Cells(k, 4).Value
    'end addition
    "REMOVED TO SAVE SPACE"-------------------------
    --------------------------------------

    the a variable in row 2 is highlighted

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Auto_Open sub gives errors after upgrade from excel 2000 to 2003

    Welcome to the Forums.

    Are you writting this in Excels VBA Editor or in VB? It sounds like your missing
    a reference. Post what you have listed.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    3

    Re: Auto_Open sub gives errors after upgrade from excel 2000 to 2003

    figured it out. It was due to an upgrade from 2000 to 2003. There was a iseven code not being recognized had to change it to mod

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Auto_Open sub gives errors after upgrade from excel 2000 to 2003

    Yes, like I posted, if you upgrade the reference to 2000 will be lost. So you need
    to add the new one to 2003. 's

    Ps, dont forget to Resolve your thread
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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