Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Calling Excel macro from Access errors

Hi

I'm calling an Excel macro from Access and get an error

440 Method 'Run' of object '_Application' failed

I've cut and pasted the offending piece of code into a separate procedu

Sub Test()

ActiveWorkbook.SaveAs Filename:= _
"C:\Apps\Reward and Recognition\Quarterly reports\" _
& "Quarterly KPIs.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

ActiveWorkbook.Close SaveChanges:=False

End Sub

Help appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Calling Excel macro from Access errors

How are you calling this from Access ?

NickHK

"Snowsride" wrote in message
...
Hi

I'm calling an Excel macro from Access and get an error

440 Method 'Run' of object '_Application' failed

I've cut and pasted the offending piece of code into a separate procedu

Sub Test()

ActiveWorkbook.SaveAs Filename:= _
"C:\Apps\Reward and Recognition\Quarterly reports\" _
& "Quarterly KPIs.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

ActiveWorkbook.Close SaveChanges:=False

End Sub

Help appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Calling Excel macro from Access errors

Dim objExcel As Excel.Application

Set objExcel = Excel.Application
With objExcel
..Visible = True
Workbooks.Open("C:\Apps\Reward and Recognition\" _
& "Quarterly reports\Template.xls").Activate

..Run "Test"

End With
---------------------------

Access opens Template.xls OK and runs other code in the Test macro but it
fails when it tries to save Template.xls under another name.




"NickHK" wrote:

How are you calling this from Access ?

NickHK

"Snowsride" wrote in message
...
Hi

I'm calling an Excel macro from Access and get an error

440 Method 'Run' of object '_Application' failed

I've cut and pasted the offending piece of code into a separate procedu

Sub Test()

ActiveWorkbook.SaveAs Filename:= _
"C:\Apps\Reward and Recognition\Quarterly reports\" _
& "Quarterly KPIs.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

ActiveWorkbook.Close SaveChanges:=False

End Sub

Help appreciated.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling access data from excel batuhan Excel Discussion (Misc queries) 1 August 18th 06 10:17 AM
Calling a bit of code from a sheet errors gearoi Excel Discussion (Misc queries) 2 September 6th 05 08:21 PM
calling a stored access query from excel vba Travis Excel Programming 1 April 25th 05 09:11 PM
calling an MS Access query from within VBA for Excel Shane Ambry Excel Programming 0 August 18th 04 08:38 AM
Calling Access Program from Excel John Baker Excel Programming 1 April 24th 04 01:20 PM


All times are GMT +1. The time now is 06:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"