Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

activereports problem-excel 2007 and 2010

Status
Not open for further replies.

baran121

Programmer
Sep 8, 2005
337
0
0
TR
hello ,
i am using ActiveReports 2.0 in visual basic 6.0
i can use its feature for excel 97-2000-2003. but i can not use it for excel 2007 and excel 2010

so there is the code :

Sub excel_at(p_obj As ActiveReport)
On Error GoTo err1
Dim xls As ARExportExcel
Dim xpath As String
Dim ret As Double


Set xls = New ARExportExcel
xls.FileName = App.path & "\XLReport.xls"
p_obj.Run False
xls.Export p_obj.Pages
Set p_obj = Nothing
Set xls = Nothing

xpath="C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE"
ret = Shell(xpath & " " & App.path & "\XLReport.xls", vbMaximizedFocus)

Exit Sub

err1:
MsgBox Err.Description, 64, "ERROR"
End Sub

please help me.
 
How about you tell us exactly what error you are getting? "but i can not use it" gives me no information that I can diagnose.

However, one guess is that C:\Program Files\Microsoft Office\OFFICE11\ is not the correct directory for Excel 2007/2010, since that's where my Excel 2003 is installed.
 
It seems you may know how to Automate ActiveReports so why not Automate Excel too?
 
So - you are using ActiveReports to generate a report. You then use ActiveReports to export an XLS file.

You then use VB to use the Shell to launch that XLS file in Excel 2003.

Which bit is not working for Excel 2007/2010?

I'm guessing the Shell command (as per HughLerwill) - which in your code is very specific to Excel 2003
 
thank you,
yes it is office 2010, but i am using both of them 2003 and 2010 on the same computer.

i used also this path;
xpath="C:\Program Files\Microsoft Office\OFFICE14\EXCEL.EXE"

yes i know that ActiveReports, it is easy to use it for office 97,2000, and 2003, with it i dont need to write any other code, if it is possibly i prefer ActiveReports, if not

how can i use Shell command ?
i dont have enough documantary about it.




 
Right - so we've established that it isn't actually a VB problem.

My money is on it being an ActiveReports issue. Are you running the latest build?
 
thank you very much strongm .
you are right i must use latest version of activereport.
so now i can get report from excel 2007 and 2010.
thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top