M
Matilda
Hi,
This is round 2 with this problem. Having read all the near-to problems and
solutions in this forum, (and having sorted out the development environment
issues), I think I need to re-state the problem because I just CANNOT get it
to work. When it comes to the crunch line I get a " Macro [name] cannot be
found" error.
Here's what I'm trying to do:
In Access
1. Output recordset to excel temporary file
2. Execute some code from global store (personal.xls)
(code creates and saves new file)
3. kill the temporary file
4. close excel
Here's my code:
( temporary file with recordset is generated and sitting there open at this
point)
Sub newcode()
Dim xlApp As Variant
Set xlApp = Excel.Application
xlApp.Workbooks.Open "C:\[pathname]\personal.xls"
xlApp.Run ("myBrilliantCode") ' here is where I get the error msg
' rest of code here
End Sub
Clearly I cannot execute code from personal.xls like this, but
I do not want to use a template for the recordset, and store the code in
that, because I will not have control over the sheetnames when a new sheet is
added, and that will break my code .
Is it NOT possible to use personal.xls in this way?
Many thanks in advance,
Matilda
This is round 2 with this problem. Having read all the near-to problems and
solutions in this forum, (and having sorted out the development environment
issues), I think I need to re-state the problem because I just CANNOT get it
to work. When it comes to the crunch line I get a " Macro [name] cannot be
found" error.
Here's what I'm trying to do:
In Access
1. Output recordset to excel temporary file
2. Execute some code from global store (personal.xls)
(code creates and saves new file)
3. kill the temporary file
4. close excel
Here's my code:
( temporary file with recordset is generated and sitting there open at this
point)
Sub newcode()
Dim xlApp As Variant
Set xlApp = Excel.Application
xlApp.Workbooks.Open "C:\[pathname]\personal.xls"
xlApp.Run ("myBrilliantCode") ' here is where I get the error msg
' rest of code here
End Sub
Clearly I cannot execute code from personal.xls like this, but
I do not want to use a template for the recordset, and store the code in
that, because I will not have control over the sheetnames when a new sheet is
added, and that will break my code .
Is it NOT possible to use personal.xls in this way?
Many thanks in advance,
Matilda