Re: Change file reference on OLE object

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




Cathy,

Not tested. Digging up old code

If (1) doesn't do the job, try (2)

(1)
=obj.workbooks(1).SaveAs(NewDocumentPath)

(2)
=obj.workbooks(1).SaveAs(NewDocumentPath)
=obj.workbooks(1).Close()
=obj.workbooks.Open(NewDocumentPath)

Gregory
__________

"Cathy Neppel" <Cathy Neppel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:F9D1959E-7FAD-486C-9107-0604C2F67C06@xxxxxxxxxxxxxxxx
Hi,

I have an Excel file that I'm displaying in a VFP form using an OLE control,
linking it to a local file.

Problem is, sometimes that local file gets locked up, and I can't overwrite
it with new data in order to display it in my form. Either the user has it
open in Excel, or in some cases, just having Excel open locks it up (can't
figure that one out...)

I would like to be able to dynamically change the file name that I'm
displaying, so that I can control it from within the program and not have it
hard-coded. But the OLE control's DocumentFile property is read-only at run
time.

Any ideas on this? Am I using the control wrong, or the wrong control?

Thanks,
Cathy

.



Relevant Pages

  • Re: Making something visible based on a condition
    ... Cathy wrote: ... >> I meant to add that conditional formatting doesn't allow ... >> In a continuous form there really isn't a way to do this, ... > don't *really* need to hide a control - how important is ...
    (microsoft.public.access.formscoding)
  • Re: Catching reload error
    ... without reloading.. ... I do have full control over the data, so I can do whatever is ... You don't need to identify the browser, ... Yes, local file. ...
    (comp.lang.javascript)
  • XP SP2 Problem with web browser control
    ... when using the navigate() method to navigate to ... a local file, I get a file open/save prompt. ... the hosted control. ... Everything works fine prior to SP2. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Flash in Powerpoint issues
    ... I can point to the URL from Powerpoint's Shockwave Flash Control. ... I use the same control to point to the local file. ... MS PowerPoint MVP Team ...
    (microsoft.public.powerpoint)
  • Re: Using Local File Links in Web Browser Control
    ... > I've got a WebBrowser control in a C# Windows form. ... except that part of the HTML that I ... > construct is an element that links to a local file, ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)