keimpe
asked on
Office (Excel) document preview in VB6 or Access?
When I open a directory on my computer and select an Excel document, I see a preview of that document on the right hand side.
Is there any way to mimic this behaviour in VB6 or on an Access form?
In other words: can I show an Excel preview or thumbnail on an Access or VB6 form?
Thank you!
Is there any way to mimic this behaviour in VB6 or on an Access form?
In other words: can I show an Excel preview or thumbnail on an Access or VB6 form?
Thank you!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It does work on another machine with Office 2007 installed, so I need to do a little more testing on another 2010 machine. Maybe my office installation has gone bonkers (again). I'll report back here a.s.a.p. (but probably not today).
A little bonus question maybe: do you (or does anyone here) think it's possible (and if so, how) to show the Print Preview of an Excel sheet in the webbrowser control?
A little bonus question maybe: do you (or does anyone here) think it's possible (and if so, how) to show the Print Preview of an Excel sheet in the webbrowser control?
There's also a Navigate2 method of the control - can't recall what the difference is, but you might try using that instead of Navigate.
I don't know about the preview, since I'm not sure exactly how Excel renders the preview. I would think that no, you could not do that, since the Preview would be rendered in the Windows printing subsystem - but I could be wrong.
I don't know about the preview, since I'm not sure exactly how Excel renders the preview. I would think that no, you could not do that, since the Preview would be rendered in the Windows printing subsystem - but I could be wrong.
ASKER
I've tried Navigate2 with the same result (in my flawed Office 2010 installation), and I guess you're right about the preview impossibility.
ASKER
It seems we're out of luck. Navigating to Office 2007 (and up) files, opens them in their own program by design. Here's a 2007 workaround
I've yet to find a 2010 workaround.
Any other ideas on how to preview Excel files without opening them?
I've read you can save a thumbnail when you choose Save As, which seems true:
But where can I find the resulting thumbnail???
I've yet to find a 2010 workaround.
Any other ideas on how to preview Excel files without opening them?
I've read you can save a thumbnail when you choose Save As, which seems true:
But where can I find the resulting thumbnail???
I'm not sure how the Windows system previews them without opening, so I can't help any with that.
You could try the new Attachment feature of 2010, but this would require you to store the file in the Attachment field. Even then I believe you'd be out of luck with the preview, since I believe clicking on the item in the Attachment viewer will just launch the file in the host application.
You could also use the OLE Object control (the "Unbound Object Control") and set the SourceDoc property as needed. This won't really preview the item, it will actually open the item and allow the user to edit it, but it may serve your purpose.
You could try the new Attachment feature of 2010, but this would require you to store the file in the Attachment field. Even then I believe you'd be out of luck with the preview, since I believe clicking on the item in the Attachment viewer will just launch the file in the host application.
You could also use the OLE Object control (the "Unbound Object Control") and set the SourceDoc property as needed. This won't really preview the item, it will actually open the item and allow the user to edit it, but it may serve your purpose.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Fine with me - just be careful with controls that are not designed specifically to work in the Access environment.
ASKER
LSMConsulting's webbrowser solution is easiest and best for viewing Excel files up to and sometimes including 2007. My ActiveX solution is the only way for viewing Excel 2010 files. If you use a webbrowser it always opens the Excel file in a new window.
@LSMConsulting: Are you OK with the fact that I split the solution and the points?
@LSMConsulting: Are you OK with the fact that I split the solution and the points?
ASKER
this is the code used:
Open in new window
Any idea why it won't show up in the browser control?