Results 1 to 18 of 18

unable to load & save a workbook from a VBA function

Threaded View

Paul VanLeer unable to load & save a... 06-23-2013, 07:21 AM
patel45 Re: unable to load & save a... 06-23-2013, 07:30 AM
Paul VanLeer Re: unable to load & save a... 06-23-2013, 08:08 AM
Norie Where are you trying to use... 06-23-2013, 08:18 AM
Paul VanLeer Re: unable to load & save a... 06-23-2013, 09:24 AM
Norie Re: unable to load & save a... 06-23-2013, 10:12 AM
patel45 Re: unable to load & save a... 06-23-2013, 10:15 AM
Paul VanLeer Re: unable to load & save a... 06-23-2013, 01:45 PM
Norie Re: unable to load & save a... 06-23-2013, 02:25 PM
Paul VanLeer Re: unable to load & save a... 06-23-2013, 02:52 PM
Norie Re: unable to load & save a... 06-23-2013, 03:10 PM
Paul VanLeer Re: unable to load & save a... 06-23-2013, 03:34 PM
Paul VanLeer Re: unable to load & save a... 06-23-2013, 08:00 PM
Norie Yes, but not with a UDF. 06-24-2013, 05:42 AM
Paul VanLeer Re: unable to load & save a... 06-24-2013, 07:12 AM
patel45 Re: unable to load & save a... 06-24-2013, 09:19 AM
arlu1201 Re: unable to load & save a... 06-24-2013, 11:02 AM
Paul VanLeer Re: unable to load & save a... 06-24-2013, 11:18 AM
  1. #1
    Registered User
    Join Date
    06-23-2013
    Location
    Elmer, New Jersey, YSA
    MS-Off Ver
    Excel 2013
    Posts
    9

    unable to load & save a workbook from a VBA function

    Here's what I have so far

    Option Explicit
    
    Function LRS(ByVal instring As String)
    
     ' where instring is the name of an xlsx workbook
     
     Dim result As Integer
      
     Dim rootPath As String
        rootPath = ThisWorkbook.Path
        rootPath = rootPath & "\"
        'MsgBox "root path " & rootPath
    
      
     Dim Filename As Variant
     Filename = rootPath & "\" & instring & ".xlsx"
     If instring <> "" Then
        result = LRS_do_one(Filename)
     End If
      
     End Function
    Function LRS_do_one(Filename)
      
     MsgBox "Doing " & Filename     ' gives popup w expected results
     
     Workbooks(Filename).Open       ' doesn't to anything
     Workbooks(Filename).Activate   ' doesn't to anything
     Workbooks(Filename).RefreshAll ' doesn't to anything
     Workbooks(Filename).Save       ' doesn't to anything
     Workbooks(Filename).Close      ' doesn't to anything
      
    End Function
    Last edited by arlu1201; 06-24-2013 at 11:00 AM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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