Calling Excel from Access issue.

  • Thread starter Thread starter Steven Britton via AccessMonster.com
  • Start date Start date
S

Steven Britton via AccessMonster.com

When I call out an Excel Application from Access and load a query or anything
into Excel for what ever reason it doesn't open my personal.xls sheet as well
as an Add-In that contains a bunch of code used in keyboard short cuts.

Does anyone know why this happens and better yet how to correct it? I know
this is the access forum, but well all send info out of Access into Excel.
If my user has a personal.xls sheet that he/she uses macros from and it's not
available when Access kicks out said file - that bad bad stuff...

This is the call:
Set xlsApp = CreateObject("Excel.Application")
xlsApp.Visible = True

Thanks in advance-

-Steven M. Britton
 
Steve:

I may not understand all the specifics of your situation, however, I can
offer some general suggestions.

To open the personal.xls workbook, your code might look something like the
following:

Dim xlsapp As Excel.Application
Dim wkb As Workbook
Set xlsapp = CreateObject("Excel.Application")
xlsapp.Visible = True

Set wkb = xlsapp.Workbooks.Open("C:\personal.xls")

Regarding the Excel add-in, you might try something like the following:

If Not wkb.Application.AddIns("MyAddIn").Installed Then
wkb.Application.AddIns.Add ("C:\MyAddIn.xla")
wkb.Application.AddIns("MyAddIn").Installed = True
End If

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


message When I call out an Excel Application from Access and load a query or
anything
into Excel for what ever reason it doesn't open my personal.xls sheet as
well
as an Add-In that contains a bunch of code used in keyboard short cuts.

Does anyone know why this happens and better yet how to correct it? I know
this is the access forum, but well all send info out of Access into Excel.
If my user has a personal.xls sheet that he/she uses macros from and it's
not
available when Access kicks out said file - that bad bad stuff...

This is the call:
Set xlsApp = CreateObject("Excel.Application")
xlsApp.Visible = True

Thanks in advance-

-Steven M. Britton
 
David thanks for your response and I appreciate your suggestions, but I think
I need to explain the proposed situation a bit further...

I could call the wkb.Application.AddIns.Add ("C:\MyAddIn.xla") if I knew in
fact the name of the add-in that a user may have created.

As an example if I had a high end Excel user who created an Add-in that
contained code to format various reports & use keyboard shortcuts to things
like ("Paste Values" = ctrl + shift + Q ) as an example then said user gave
this add-in to three people in their department. I may never know that this
add-in existed and when Access sends a file into a new excel window this add-
in doesn't load, this would cause frustration by the end user loosing there
custom functionality.

Hope this is clearer to everyone. Thoughts?

-Steven M. Britton
 
Back
Top