+ Reply to Thread
Results 1 to 7 of 7

VBA code to execute a module in a different workbook

Hybrid View

Need_help_please VBA code to execute a module... 04-05-2012, 08:51 AM
Kelshaer Re: VBA code to execute a... 04-05-2012, 09:04 AM
111StepsAhead Re: VBA code to execute a... 04-05-2012, 09:06 AM
Kelshaer Re: VBA code to execute a... 04-05-2012, 10:20 AM
Need_help_please Re: VBA code to execute a... 04-06-2012, 01:48 AM
Need_help_please Re: VBA code to execute a... 04-06-2012, 05:00 AM
Need_help_please Re: VBA code to execute a... 04-06-2012, 06:27 AM
  1. #1
    Registered User
    Join Date
    12-27-2011
    Location
    -
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: VBA code to execute a module in a different workbook

    it's definitely the space in the name
    (when i removed it the code worked fine).

    So my question is what to change in the code to make it working for files with spaces in their name also.

    Thanks in advance

  2. #2
    Registered User
    Join Date
    12-27-2011
    Location
    -
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: VBA code to execute a module in a different workbook

    Made some changes to the code so I could put the file name between an extra pair of single quotes ' ' to deal with spaces and "-" in file names:

    Private Sub CommandButton1_Click()
        Workbooks.Open ("\\Nw_edc_02\apps1\Starquery\Werkfolder\WR\xls\aantal picks.xls")
        Application.Run ("'aantal picks.xls'!Updbtn_Update")
    End Sub

    Found here: http://stackoverflow.com/questions/2...ontains-spaces

+ 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