0

Hi all I am getting error when i tried to import the data from the excel file. At the point when lotusscript opens the workbook i am getting error as `

" Microsoft Excel: Office has detected a problem with this file cannot be opened. Error in XlsWeb In Initialise 70"`

And in line number 70 I am trying to open the workbook.

Set xlsApp = CreateObject("Excel Application");
MessageBox varfilename
xlsApp.Workbooks.Open varfilename

In logs

E:\temp\09-09-2016042956AM.xls

I have some files which import correctly but the file which i received it is not able to open the FILE and giving me this error. Kindly let me know if there is any problem with the file. I guess in coding there is no error as we other files are working correctly

LotusWorst
  • 31
  • 1
  • 9
  • 1
    Well, there's not much we can tell you about the file. What happens when you try to open it with Excel? Does it prompt for a password? Is it encrypted? Read-only? Is actually an Excel spreadsheet and not just a file with an .xls file extension? We can't help determine any of that. – Duston Sep 09 '16 at 14:45
  • @Duston It is Compatiblity Mode (Read Only). No it dosent prompt for any password or there is nothing about encryption as well – LotusWorst Sep 09 '16 at 16:14
  • Are the other files that can be opened in LotusScript also opened by Excel in Compatability Mode (Read Only)?? – Richard Schwartz Sep 10 '16 at 02:37
  • 1
    Shouldn't it be Excel.Application, with a dot? – D.Bugger Sep 10 '16 at 11:52
  • I noticed that, too. But the error message says "Microsoft Excel", so clearly the CreateObject call was able to handle "Excel Application" and call into Excel. Still, though, I'm wondering if this is a version incompatibility, and perhaps either "Excel.Application" or "Excel.Application.x" (where x is a version number - see http://stackoverflow.com/questions/455326/how-can-i-start-a-specific-excel-version-in-com-automation) might work better. – Richard Schwartz Sep 11 '16 at 02:49

1 Answers1

-1

Don't use xlsApp.Workbooks.Open at all, but make Excel visible and give the user control

xlsApp.Visible      = True
xlsApp.UserControl  = True

then just 'End Sub' out of your routine.

Robert Howe
  • 314
  • 1
  • 11