Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excell FileOPenDialog from another App, and listbox multiselect problems
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) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excell FileOPenDialog from another App, and listbox multiselect problems
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) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excell FileOPenDialog from another App, and listbox multiselect problems
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) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excell FileOPenDialog from another App, and listbox multiselect problems
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) |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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) |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excell FileOPenDialog from another App, and listbox multiselect problems
Sean,
Go the API way. It's not much code and will avoid your Excel problems. NicHK "What-a-Tool" wrote in message news:jPl7d.28400$cN6.3578@lakeread02... 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) |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excell FileOPenDialog from another App, and listbox multiselect problems
Thanks for the advice. Will do.
Not often that the easy way out is the right way out I guess. -- / 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, Go the API way. It's not much code and will avoid your Excel problems. NicHK "What-a-Tool" wrote in message news:jPl7d.28400$cN6.3578@lakeread02... 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) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiselect Listbox use | Excel Discussion (Misc queries) | |||
Multiselect listbox selection question | Excel Programming | |||
MultiSelect ListBox in Excel | Excel Programming | |||
Excel VBA-Looping though MultiSelect on ListBox | Excel Programming | |||
multiselect listbox | Excel Programming |