Excel Free Viewer no longer works with Xojo

Hello,

I just found out that Xojo (or the plugin?) with the free Excel Viewer no longer works. Is anyone else having this problem? The free Excel Viewer can be downloaded from Free 2007 Excel Viewer . Example code is as follows:

[code] Dim excel As New ExcelApplication

excel.Visible = True
excel.Workbooks.Add

excel = Nil

Exception err as OLEException
MsgBox err.Message
[/code]

I created Feedback 29385 to investigate this issue further. Thanks for your help,

Eugene

Hi Eugene

I can open up the viewer no problem from within xojo (R2) and that automatically invokes the open file dialogue in the viewer. What I am unable to do is to pass a command line to the viewer with the (for example) .xlsx file.

I am hacking it using

Dim F as new FolderItem
Dim A as String =
A=“E:\OFFICE 2010\Office12\xlview e:\office 2010\office12\book1.xlsx” // this does not work but A=“E:\OFFICE 2010\Office12\xlview” will
f.name=A
f.Launch

if A is set “E:\OFFICE 2010\Office12\xlview” then the viewer opens up but with the .xlsx filename it does not - yet

“E:\OFFICE 2010\Office12\xlview book1.xlsx” works just fine from the start menu

It’s all a bit weird tbh

Nick

I’d be surprised is this ever worked, but it sounds like the free Excel Viewer doesn’t include the necessary Object Libraries required for automation.

[quote]Dim F as new FolderItem
Dim A as String =
A=“E:\OFFICE 2010\Office12\xlview e:\office 2010\office12\book1.xlsx” // this does not work but A=“E:\OFFICE 2010\Office12\xlview” will
f.name=A
f.Launch
[/quote]

@Nick, what about this:

Dim F as new FolderItem("e:\\office 2010\\office12\\book1.xlsx") f.Launch

Hi William

Things get screwed up if there’s a space in the folder name. Your example opens excel itself not the viewer

What works is

Dim a as string = “e…xlsx” // full path of xlsx file
Dim F as new FolderItem(“e:\office 2010\office12\xlview”)
f.Launch a

But the space seems to mess everything up
Thanks though

Nick

What if you double quote everything inside a?

i.e. f.Launch Chr(34) + a + Chr(34)

I’m using Chr(34) to represent a double quote instead of “”"" which is harder to read, but either works.

Dim F as new FolderItem(""“e:\office 2010\office12\xlview”"") // Does this work Nick?

Hi Rick/William

The issue is not the double quote marks (as far as I can workout) - the issue is when passing a file name (like book1.xlsx) when the full path has a space in it like “E:\office 2010\office12\book1.xlsx” does not work. The space (between office and 2010) is representing an end of the passed variable. So when using

Dim F as new Folderitem(“E:\office 2010\office12\xlview E:\office 2010\office12\book1.xlsx”)

the viewer loads up and it throws two errors " - “E:\office.xlsx” could not be found AND “office12\book1.xlsx” could not be found. This is not a xojo problem but an office problem as far as I can see.

Thanks for your help though

I wonder if it would be able to use a symbolic link created with the mklink shell command in Vista and up? I.e.:

[code]mkdir c:“my dir”
mklink /D c:“my dir” mynewdir /*create the link */

dir c:\mynewdir /*list contents */

rmdir c:\mynewdir /*remove the link - leaves original “my dir” intact */[/code]

Worth a shot…

Hello Everyone,

I tried running excel on a fresh installation of Windows 7 with Real Studio 2012 R2 and it doesn’t appear to work. My mistake.

Thanks for trying!

Sincerely,

Eugene