Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Open Excel 2007

Former Member
0 Likes
1,703

Hi Experts,

     I'm using

CREATE OBJECT h_excel 'EXCEL.APPLICATION'.

for opening MS-Excel document.

It is opening in Excel 2003 version.

Is it possible to open the Excel in 2007 Version? How can this be achieved?

Please do help.

Thanks & Regards,
Sowmya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,646

The issue is resolved.

It is not with the code.

The issue was with the Server version.

-Thanks & Regards,

Sowmya

8 REPLIES 8
Read only

Former Member
0 Likes
1,646

Use this to achieve the upload

Private Declare Sub Sleep Lib "kernel32" _

  (ByVal dwMilliseconds As Long)

Sub StartExcel()

  Dim objExcel As Object

  On Error Resume Next

 

  Set objExcel = GetObject("Excel.Application")

 

  If Err.Number <> 0 Then

   

    Set objWshShell = CreateObject("WScript.Shell")

    objWshShell.Run "Excel.exe /s"

   

    Do While Not objExcel Is Nothing

      Sleep 250

      Set objExcel = GetObject("Excel.Application")

    Loop

   

  End If

 

  On Error GoTo 0

 

  objExcel.Visible = True

End Sub

Karthik.R

Read only

0 Likes
1,646

ABAP OLE2 code pls.

***************** creates an excel application
  CREATE OBJECT h_excel 'EXCEL.APPLICATION'.

*Sheet1
  CALL METHOD OF
      h_excel
      'Workbooks' = h_mapl.
  SET PROPERTY OF h_excel 'Visible' = 1.

*************** opens a work book
  CALL METHOD OF
      h_mapl
      'Add'  = h_map.

How to open the Excel Appln in 2007 version?

Thanks,
Sowmya

Read only

0 Likes
1,646

Did you enabled the settings for macros in 2007 format

Read only

0 Likes
1,646

Yes Karthik. It is enabled in 2007.

Read only

0 Likes
1,646

Check the settings.Click on the office button in the top left hand corner of xls ->Excel options->Trust center-> trust center settings->macro settings->Check "enable all macros"-> and also check the "trust access to vba".

Read only

0 Likes
1,646

Trust access to VBA is checked, but not "Enable all macros..." is not checked as I dont have authorization.

Read only

Former Member
0 Likes
1,646

As per my knowledge if u enable macros.It will work perfectly.If it is disabled contact sys admin

Read only

Former Member
0 Likes
1,647

The issue is resolved.

It is not with the code.

The issue was with the Server version.

-Thanks & Regards,

Sowmya