ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Execution Error due to file location (https://www.excelbanter.com/excel-programming/294836-execution-error-due-file-location.html)

Jim W[_3_]

Execution Error due to file location
 
I have a little application that I would like to have available for
use for various organizational locations via a intranet link. If I run
the application (inside Excel) from a web directory it works fine but
I want to simplify the install by keeping the original on a web server
to be opened via Internet Explorer using Excel. I've developed a web
page that links to the file but the script freezes when I try any of
the following statements. I want the user to be able to choose which
directory they pull a file from to import it to my application and I
believe the problem may be due to some confusion between using Excel
while in the IE link. Any thoughts?

Application.Dialogs(xlDialogOpen).Show '"*.xls"

Workbooks.Open Filename:=Application.GetOpenFilename

Thanks in advance.

Jim

Dave Peterson[_3_]

Execution Error due to file location
 
I'm betting that application refers to MSIE.

Maybe you could do something like:

ThisWorkbook.Parent.dialogs(....).show

The parent of the workbook would be excel.

Untested in MSIE, but both give the same results within excel:

Dim xlApp As Application
Set xlApp = ThisWorkbook.Application
MsgBox xlApp.Name

or

Dim xlApp As Application
Set xlApp = ThisWorkbook.Parent
MsgBox xlApp.Name

then you could do:

xlapp.dialogs(...).show

instead of using that long style.

Jim W wrote:

I have a little application that I would like to have available for
use for various organizational locations via a intranet link. If I run
the application (inside Excel) from a web directory it works fine but
I want to simplify the install by keeping the original on a web server
to be opened via Internet Explorer using Excel. I've developed a web
page that links to the file but the script freezes when I try any of
the following statements. I want the user to be able to choose which
directory they pull a file from to import it to my application and I
believe the problem may be due to some confusion between using Excel
while in the IE link. Any thoughts?

Application.Dialogs(xlDialogOpen).Show '"*.xls"

Workbooks.Open Filename:=Application.GetOpenFilename

Thanks in advance.

Jim


--

Dave Peterson



All times are GMT +1. The time now is 08:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com