+ Reply to Thread
Results 1 to 2 of 2

workbooks.open error

Hybrid View

  1. #1
    Registered User
    Join Date
    04-26-2012
    Location
    atlanta, georgia
    MS-Off Ver
    Excel 2003
    Posts
    1

    workbooks.open error

    Hi I am trying to do something simple but I am getting an error:

    "Invalid Outside Procedure"

    It highlights the path of my file:

    Dim excelApp As Excel.Application
    Dim wr1 As Excel.Range
    Dim SigString As String
    Dim Signature As String
    Dim Sheet1 As Excel.Worksheet
    
    
        Workbooks.Open Filename:="d:\test.xls", UpdateLinks:=0 _
            , ReadOnly:=True, Notify:=False
        
     Windows("test.xls").Activate
        Range("A1").Select
        Selection.Copy
        Windows("test.xls").Activate
        Range("C1").Select
        
    End
    
    
    Application.Quit
    Last edited by Leith Ross; 04-26-2012 at 03:14 PM. Reason: Added Code Tags

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: workbooks.open error

    Not really sure what you are trying to do but perhaps a macro like this could be of help?

    Option Explicit
    
    Sub open_file()
        Workbooks.Open Filename:="d:\test.xls", UpdateLinks:=0 _
            , ReadOnly:=True, Notify:=False
            
     Range("Sheet1!A1").Copy
     Range("Sheet2!C1").PasteSpecial Paste:=xlPasteValues
     
     Application.CutCopyMode = False
     
    End Sub
    Alf

+ Reply to Thread

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