View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
What-a-Tool What-a-Tool is offline
external usenet poster
 
Posts: 14
Default Excell FileOPenDialog from another App, and listbox multiselect problems

Yes it does. Its a VBA macro that I am writing for it.

This is what I got on the SW NewsGroup (From: "That70sTick"):

<<<<<The Windows Common Dialog object used for
opening/saving/colors/priniting is not licensed for use in SW VBA. You
have to access it using Windows API calls (Declare...etc.).

I could do this, but its a lot of code. Probably will end up going with
this, unless someone has a solution for using the Excel application dialog?

The easiest way to do it is by declaring the Excel application object and
using the GetOpenFileName Dialog from that. (Well, it would be if it worked
properly, anyway - but it doesn't). Gives me the "Server is Busy - Retry or
Switch" message. I'm not on a network, either

--

/ Sean the Mc /


"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"NickHK" wrote in message
...
Sean,
Does this SolidWorks have a VBA interface ?

NickHK

"What-a-Tool" wrote in message
news:gRH6d.28344$cN6.26875@lakeread02...
Thanks for the help with the list box problem. That, I AM using in an

excel
macro. Could not figure out why the click event wouldn't work. Change

event
isn't perfect for me, but I can get things working.

The other problem is not from an excel macro. That is for a macro I'm
writing in a program called SolidWorks.
I know it doesn't really belong in this group, but seeing as this group

IS
full of vb experts, I was hoping someone would see my error (other than

the
wrong group posting, that is)

--

/ Sean the Mc /


"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"Tom Ogilvy" wrote in message
...
The change event will fire on each selection

in your second problem, why do you start a new instance of Excel. If

your
code resides in Excel, you don't need to start a new instance to use

the
getopenfilename.

--
Regards,
Tom Ogilvy

"What-a-Tool" wrote in

message
news:20p6d.18075$3n.6656@okepread06...
I have 2 problems -
First, I am using a list box and have "multi-select extended"

enabled.
When
I click in the box, I want to enable a button if an item is

selected,
disable if no items are selected. Problem is, with multi select

enabled,
my
box won't detect the click. With simple select, this works, but I

want
multi. Am i missing something obvious?

Problem 2 :
I am running a vba macro from another application, which it appears
doesn't
have a File open Dialog box.
I thought I could use the Excel GetOpenFileName Dialog (code

follows)
This works, but obviously I'm doing something wrong here, because I

get
a
"Server Busy - Switch Apps or Retry" Dialog right after the
GetOpenFileName
closes (gives me the filename, but this dialog warning is annoying)
Could someone tell me what I'm doing wrong here, too?

Private Sub btnBrowse_Click()
On Error GoTo Err_btnBrowse_Click
Dim fl As File
Dim eApp As New Excel.Application
'Get the path to a file with the file open dialog box
Set fl = fso.GetFile(eApp.GetOpenFilename)
eApp.Quit
Set eApp = Nothing
txtDirectory.Value = fl.ParentFolder

Err_btnBrowse_Click:
'Do Nothing
End Sub

Thanks in Advance...

--

/ Sean the Mc /


"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)