Selasa, 12 Februari 2013

Re: [ExcelVBA] Filepath referencing a cell used to autoopen a file or *.xll file

 

Please give full information ... "unable to get the code to compile" is
uninformative.

I assume the compile error you are getting is "Invalid outside procedure"?

You have assignment statements in the code at the top of your module (i.e.
the "filePath =" statements. You can't do that. All statements need to be
inside procedures (sub or function).

Move them into the Sub.

However, you'll probably then be told that sFileLocMarket is not defined.
Certainly, it isn't in the code you've provided.

You also use a variable Paths which is not defined in your given code,

Regards, Dave S

----- Original Message -----
From: "pablorynx" pablorynx@yahoo.com>
To: ExcelVBA@yahoogroups.com>
Sent: Tuesday, February 12, 2013 4:58 PM
Subject: [ExcelVBA] Filepath referencing a cell used to autoopen a file or
*.xll file

> This is the code I have in "ThisWorkbook"
> sFileLocMarket is a named range in my workbook
> I am unable to get the code to compile, I'm sure I am getting this wrong.
>
>>>
> Option Explicit
> Const xllName = "schedulesV1.0.2.xll"
> Dim filePath As String
> filePath = Paths.Range(sFileLocMarket).Value
> filePath = filePath & "\" & xllName
>
>
> Private Sub Workbook_Open()
>
> Application.RegisterXLL filePath
>
> End Sub
>
>>>
>
>
>
> ------------------------------------
>
> ----------------------------------
> Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go
> here: http://www.mousetrax.com/techtrax to enter the ezine, then search
> the ARCHIVES for EXCEL VBA.
>
> ----------------------------------
> Visit our ExcelVBA group home page for more info and support files:
> http://groups.yahoo.com/group/ExcelVBA
>
> ----------------------------------
> More free tutorials and resources available at:
> http://www.mousetrax.com
>
> ----------------------------------Yahoo! Groups Links
>
>
>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1430 / Virus Database: 2639/5598 - Release Date: 02/11/13
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar