Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I write custom reports for my company using excel to pull data out o access databases. Anyway, the issue I am having is at one of ou customers it will no longer run the report. After some debugging I hav found the following error.. Automation Error Remote Procedure Call Failed: #-2147023170 Anyway, it crashes when opening a new session of excel through th macro Here is the portion of the code that pertains to the crashing... Sub OpenTemplate(File_Path as string) Dim xlApp as excel.application Dim xlDoc as workbook set xlApp = CreateObjecT("Excel.Application") *set xlDoc = xlApp.Workbooks.Add(File_Path)* This is where it is error out. It runs just fine on my machine and al of our other customers machines.... They are running Excel 2002; and Microsoft Windows XP. Does anyone have a clue about why this would fail? The File_Path is th correct file and I can open it manually. I even did an immediates windo with just *Workbooks.Add("c:\backoff\doc1.xls")* That crashed Excel completely.. -- kralj ----------------------------------------------------------------------- kraljb's Profile: http://www.excelforum.com/member.php...nfo&userid=995 View this thread: http://www.excelforum.com/showthread.php?threadid=40094 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your code worked ok for me (xl2003 and winXP home).
Does it work ok if you open a different template? Maybe there's something wrong with that workbook on the troublesome pc?????? And is there a reason to open a new instance of excel? Why not just create the new workbook in that already running instance? kraljb wrote: I write custom reports for my company using excel to pull data out of access databases. Anyway, the issue I am having is at one of our customers it will no longer run the report. After some debugging I have found the following error.. Automation Error Remote Procedure Call Failed: #-2147023170 Anyway, it crashes when opening a new session of excel through the macro Here is the portion of the code that pertains to the crashing... Sub OpenTemplate(File_Path as string) Dim xlApp as excel.application Dim xlDoc as workbook set xlApp = CreateObjecT("Excel.Application") *set xlDoc = xlApp.Workbooks.Add(File_Path)* This is where it is error out. It runs just fine on my machine and all of our other customers machines.... They are running Excel 2002; and Microsoft Windows XP. Does anyone have a clue about why this would fail? The File_Path is the correct file and I can open it manually. I even did an immediates window with just *Workbooks.Add("c:\backoff\doc1.xls")* That crashed Excel completely... -- kraljb ------------------------------------------------------------------------ kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955 View this thread: http://www.excelforum.com/showthread...hreadid=400943 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Well, it is needed to be opened in a new excel because I am doing this to replicate what a program that I use does (vb 6 program)... I can open the workbook just fine outside... and it fails on any excel document that I try... -- kraljb ------------------------------------------------------------------------ kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955 View this thread: http://www.excelforum.com/showthread...hreadid=400943 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd add this right after the createobject line:
xlapp.visible = true to see if that gives you a clue. kraljb wrote: Well, it is needed to be opened in a new excel because I am doing this to replicate what a program that I use does (vb 6 program)... I can open the workbook just fine outside... and it fails on any excel document that I try... -- kraljb ------------------------------------------------------------------------ kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955 View this thread: http://www.excelforum.com/showthread...hreadid=400943 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a template option for Workbooks.Add(xlWBATWorksheet)? | Excel Discussion (Misc queries) | |||
I want a Master Worksheet that other Workbooks use as a template? | Excel Discussion (Misc queries) | |||
Is there a way to set up a template for new workbooks? | Excel Discussion (Misc queries) | |||
Template changes to existing workbooks | Excel Worksheet Functions | |||
macro problems with Workbooks.Add Template | Excel Programming |