Running excel add-in (added into excel - not access) in Access VBA 
Author Message
 Running excel add-in (added into excel - not access) in Access VBA

I've used the following code many times to run EXCEL VBA
code from Access 97.  
----->> x = xlApp.Run("sFormat")
This works great except that sFormat has to be in the same
XLS that xlAPP refers to.  Therefore - if I have to make a
change to sFormat - I've got to distribute it to
everyone.  So, I made sFormat an add-in, and added it to
my list of EXCEL add-ins.  Now I can see the code sFormat
when I'm in EXCEL, but when I try to run my original code,
Access can't find the sFormat code.  I tried to put the
filename in front os sFormat.  I tried with XLS and XLA -
no luck.  I even tried to put the full path in front of
that.  
-----> x = xlApp.Run
("M:\Share\DRMS\Template\JobLetterMacros!sFormat")
Still no luck.  I even verified that I did not
inadvertantly copy the XLA to my c-drive.  I feel like I'm
trying to shoot darts thru
the eye of a needle.

Thanx!

Angelo    



Sat, 17 Jul 2004 06:52:22 GMT  
 Running excel add-in (added into excel - not access) in Access VBA
Angelo,

Set reference to the Add-in in your XLS-files via the Tools|References menu.
Having the dialog open, click "Browse..." and find the add-in. The best
practice is placing add-ins in the same folder where your xls-files reside.

--
Andrei Smolin
Active XL Report - Easy way to Excel reporting
www.afalinasoft.com


Quote:
> I've used the following code many times to run EXCEL VBA
> code from Access 97.
> ----->> x = xlApp.Run("sFormat")
> This works great except that sFormat has to be in the same
> XLS that xlAPP refers to.  Therefore - if I have to make a
> change to sFormat - I've got to distribute it to
> everyone.  So, I made sFormat an add-in, and added it to
> my list of EXCEL add-ins.  Now I can see the code sFormat
> when I'm in EXCEL, but when I try to run my original code,
> Access can't find the sFormat code.  I tried to put the
> filename in front os sFormat.  I tried with XLS and XLA -
> no luck.  I even tried to put the full path in front of
> that.
> -----> x = xlApp.Run
> ("M:\Share\DRMS\Template\JobLetterMacros!sFormat")
> Still no luck.  I even verified that I did not
> inadvertantly copy the XLA to my c-drive.  I feel like I'm
> trying to shoot darts thru
> the eye of a needle.

> Thanx!

> Angelo



Sat, 17 Jul 2004 17:47:37 GMT  
 Running excel add-in (added into excel - not access) in Access VBA
You responded at 2:00AM.  You must really be a night
person.  Thanx for responding - I was out yesterday and
just saw this this morning.  

I went to TOOLS/References and every time I tried to add
my XLA to the references - I got the error "NAME CONFLICTS
WITH EXISTING MODULE, PROJECT OR OBJECT LIBRARY."  I
renamed the XLA to something no one else would use and
made sure that it was no longer on my list of add-ins or
references.  I even unchecked all the add-ins from the add-
in list.  ONly the standard REFERENCES remain. - I still
had the same problem.   Any clue.

Thanx again

Angelo

Quote:
>-----Original Message-----
>Angelo,

>Set reference to the Add-in in your XLS-files via the

Tools|References menu.
Quote:
>Having the dialog open, click "Browse..." and find the
add-in. The best
>practice is placing add-ins in the same folder where your
xls-files reside.

>--
>Andrei Smolin
>Active XL Report - Easy way to Excel reporting
>www.afalinasoft.com



>> I've used the following code many times to run EXCEL VBA
>> code from Access 97.
>> ----->> x = xlApp.Run("sFormat")
>> This works great except that sFormat has to be in the
same
>> XLS that xlAPP refers to.  Therefore - if I have to
make a
>> change to sFormat - I've got to distribute it to
>> everyone.  So, I made sFormat an add-in, and added it to
>> my list of EXCEL add-ins.  Now I can see the code
sFormat
>> when I'm in EXCEL, but when I try to run my original
code,
>> Access can't find the sFormat code.  I tried to put the
>> filename in front os sFormat.  I tried with XLS and
XLA -
>> no luck.  I even tried to put the full path in front of
>> that.
>> -----> x = xlApp.Run
>> ("M:\Share\DRMS\Template\JobLetterMacros!sFormat")
>> Still no luck.  I even verified that I did not
>> inadvertantly copy the XLA to my c-drive.  I feel like
I'm
>> trying to shoot darts thru
>> the eye of a needle.

>> Thanx!

>> Angelo

>.



Sun, 18 Jul 2004 22:56:43 GMT  
 Running excel add-in (added into excel - not access) in Access VBA
See if this MSKB article helps:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q198571

I used this to run the XIRR function (a function in an Excel add-in) in
Access.

HTH
Van T. Dinh


Quote:
> You responded at 2:00AM.  You must really be a night
> person.  Thanx for responding - I was out yesterday and
> just saw this this morning.

> I went to TOOLS/References and every time I tried to add
> my XLA to the references - I got the error "NAME CONFLICTS
> WITH EXISTING MODULE, PROJECT OR OBJECT LIBRARY."  I
> renamed the XLA to something no one else would use and
> made sure that it was no longer on my list of add-ins or
> references.  I even unchecked all the add-ins from the add-
> in list.  ONly the standard REFERENCES remain. - I still
> had the same problem.   Any clue.

> Thanx again

> Angelo



Sun, 18 Jul 2004 23:24:49 GMT  
 Running excel add-in (added into excel - not access) in Access VBA
Oh - so close!  Only problem is my Add-In code formats a
client's spreadsheet.  So I'm looking at 3 things.
1) ACCESS application
2) Client's EXCEL data (xldata)
3) EXCEL XLA code to format the client's EXCEL data
(xlFormat)
If I open the xlFormat as specified in the article then
   I can't see the xlData
If I open xlData
   I can't xlFormat  so I open xlData and
      - Tried to used xlFormat as an add-in
        (could not get access app to see it)
      - Tried to use xlFormat as a reference
        (excel would not let me define the reference as it
thought that would be a duplicate reference - not sure
why?) So I couldn't tell whether or not access could call
it.

Thanx again!

Quote:
>-----Original Message-----
>See if this MSKB article helps:

>http://support.microsoft.com/default.aspx?scid=kb;EN-
US;q198571

>I used this to run the XIRR function (a function in an
Excel add-in) in
>Access.

>HTH
>Van T. Dinh



>> You responded at 2:00AM.  You must really be a night
>> person.  Thanx for responding - I was out yesterday and
>> just saw this this morning.

>> I went to TOOLS/References and every time I tried to add
>> my XLA to the references - I got the error "NAME
CONFLICTS
>> WITH EXISTING MODULE, PROJECT OR OBJECT LIBRARY."  I
>> renamed the XLA to something no one else would use and
>> made sure that it was no longer on my list of add-ins or
>> references.  I even unchecked all the add-ins from the
add-
>> in list.  ONly the standard REFERENCES remain. - I still
>> had the same problem.   Any clue.

>> Thanx again

>> Angelo

>.



Mon, 19 Jul 2004 03:01:52 GMT  
 Running excel add-in (added into excel - not access) in Access VBA
I am sure it is possible but I don't use Excel all that much and I can see
that what you want is slightly different from the KB article.  From your
description, I think you want Access to command / run a sub in the Add-In of
an Excel spreadsheet and the sub acts / formats the same spreadsheet.

What I would suggest:

1.  Create a Sub in the Excel spreadsheet that use the Sub in the Add-In and
then let Access call the Sub in the spreadsheet rather than the Sub in the
Add-In.

2.  Leave the Sub in the Add-In but make sure you explicitly reference
EVERYTHING and see if it works.  What I meant is that a lot of method will
default the action to the ActiveDocument (Spreadsheet) but when you use
Automation, you need to specify the "ActiveDocument".

3.  Add Excel Object Library to the References Collection of your Database
and move the code for the Sub to your Access Database and run the code from
Access.  Unfortunately, you will have to fully reference Excel objects like
point 2 to make it work.

4.  If all else fail, post the clear and precise description in relevant
Excel NGs since this has more to do with Excel than Access.

HTH
Van T. Dinh


Quote:
> Oh - so close!  Only problem is my Add-In code formats a
> client's spreadsheet.  So I'm looking at 3 things.
> 1) ACCESS application
> 2) Client's EXCEL data (xldata)
> 3) EXCEL XLA code to format the client's EXCEL data
> (xlFormat)
> If I open the xlFormat as specified in the article then
>    I can't see the xlData
> If I open xlData
>    I can't xlFormat  so I open xlData and
>       - Tried to used xlFormat as an add-in
>         (could not get access app to see it)
>       - Tried to use xlFormat as a reference
>         (excel would not let me define the reference as it
> thought that would be a duplicate reference - not sure
> why?) So I couldn't tell whether or not access could call
> it.

> Thanx again!



Mon, 19 Jul 2004 08:21:42 GMT  
 Running excel add-in (added into excel - not access) in Access VBA
I still need to reference everything explicitly, but the
sub calling the add-in works great!  Now I just need to
work on the explicit references since all the tabs ar
named and created by the user.  This gets me what I
needed.

Thanx a meg (make that a gig) for all the help!

Angelo

Quote:
>-----Original Message-----
>I am sure it is possible but I don't use Excel all that
much and I can see
>that what you want is slightly different from the KB
article.  From your
>description, I think you want Access to command / run a

sub in the Add-In of
Quote:
>an Excel spreadsheet and the sub acts / formats the same
spreadsheet.

>What I would suggest:

>1.  Create a Sub in the Excel spreadsheet that use the

Sub in the Add-In and
Quote:
>then let Access call the Sub in the spreadsheet rather
than the Sub in the
>Add-In.

>2.  Leave the Sub in the Add-In but make sure you

explicitly reference
Quote:
>EVERYTHING and see if it works.  What I meant is that a
lot of method will
>default the action to the ActiveDocument (Spreadsheet)
but when you use
>Automation, you need to specify the "ActiveDocument".

>3.  Add Excel Object Library to the References Collection
of your Database
>and move the code for the Sub to your Access Database and
run the code from
>Access.  Unfortunately, you will have to fully reference
Excel objects like
>point 2 to make it work.

>4.  If all else fail, post the clear and precise

description in relevant
Quote:
>Excel NGs since this has more to do with Excel than
Access.

>HTH
>Van T. Dinh



>> Oh - so close!  Only problem is my Add-In code formats a
>> client's spreadsheet.  So I'm looking at 3 things.
>> 1) ACCESS application
>> 2) Client's EXCEL data (xldata)
>> 3) EXCEL XLA code to format the client's EXCEL data
>> (xlFormat)
>> If I open the xlFormat as specified in the article then
>>    I can't see the xlData
>> If I open xlData
>>    I can't xlFormat  so I open xlData and
>>       - Tried to used xlFormat as an add-in
>>         (could not get access app to see it)
>>       - Tried to use xlFormat as a reference
>>         (excel would not let me define the reference as
it
>> thought that would be a duplicate reference - not sure
>> why?) So I couldn't tell whether or not access could
call
>> it.

>> Thanx again!

>.



Mon, 19 Jul 2004 22:47:07 GMT  
 Running excel add-in (added into excel - not access) in Access VBA
Angelo,

Change the default project name with something project-specific. I stepped
on these rakes too <g>

--
Andrei Smolin
Active XL Report - Easy way to Excel reporting
www.afalinasoft.com


Quote:
> I still need to reference everything explicitly, but the
> sub calling the add-in works great!  Now I just need to
> work on the explicit references since all the tabs ar
> named and created by the user.  This gets me what I
> needed.

> Thanx a meg (make that a gig) for all the help!

> Angelo

> >-----Original Message-----
> >I am sure it is possible but I don't use Excel all that
> much and I can see
> >that what you want is slightly different from the KB
> article.  From your
> >description, I think you want Access to command / run a
> sub in the Add-In of
> >an Excel spreadsheet and the sub acts / formats the same
> spreadsheet.

> >What I would suggest:

> >1.  Create a Sub in the Excel spreadsheet that use the
> Sub in the Add-In and
> >then let Access call the Sub in the spreadsheet rather
> than the Sub in the
> >Add-In.

> >2.  Leave the Sub in the Add-In but make sure you
> explicitly reference
> >EVERYTHING and see if it works.  What I meant is that a
> lot of method will
> >default the action to the ActiveDocument (Spreadsheet)
> but when you use
> >Automation, you need to specify the "ActiveDocument".

> >3.  Add Excel Object Library to the References Collection
> of your Database
> >and move the code for the Sub to your Access Database and
> run the code from
> >Access.  Unfortunately, you will have to fully reference
> Excel objects like
> >point 2 to make it work.

> >4.  If all else fail, post the clear and precise
> description in relevant
> >Excel NGs since this has more to do with Excel than
> Access.

> >HTH
> >Van T. Dinh



> >> Oh - so close!  Only problem is my Add-In code formats a
> >> client's spreadsheet.  So I'm looking at 3 things.
> >> 1) ACCESS application
> >> 2) Client's EXCEL data (xldata)
> >> 3) EXCEL XLA code to format the client's EXCEL data
> >> (xlFormat)
> >> If I open the xlFormat as specified in the article then
> >>    I can't see the xlData
> >> If I open xlData
> >>    I can't xlFormat  so I open xlData and
> >>       - Tried to used xlFormat as an add-in
> >>         (could not get access app to see it)
> >>       - Tried to use xlFormat as a reference
> >>         (excel would not let me define the reference as
> it
> >> thought that would be a duplicate reference - not sure
> >> why?) So I couldn't tell whether or not access could
> call
> >> it.

> >> Thanx again!

> >.



Wed, 21 Jul 2004 01:05:27 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. how to add a new dataset from excel to access by means of vba

2. Excel vba code not finding workbook, adds .xls extension

3. Opening an excel file through a form/running excel macros through access

4. Excel Add-in from Access

5. Excel wrongly loading Access database add-in

6. Add-In/Utility to cleanup Access Excel export

7. Run Excel Macro through Access VBA

8. Problem in running Excel sort function in Access using VBA

9. Run Access Macro From Excel - VBA

10. Excel VBA macro to run Access Report

11. read excel file in access 2000 lire fichier excel dans access 2000

12. VBA Error Handler add-in will not update in Access 2000, Visual Basic Editor

 

 
Powered by phpBB® Forum Software