I'm not sure that helps. You're still referring to each specifically with the select case statement. Can you consider the shapes an array and find the one with that is selected?
maybe something like (syntax may be wrong since I haven't tried in Excel):
for each shp in Sheets("Sheet1").shapes...
Is there a way to find out which option button on a worksheet is selected by looping through an option button array? I remember doing something like this in VB5. I'm trying to do the same in VBA in Excel now but can't make the button names an array. Right now I have to check each button...
D'OH The compatibility flag was set back to 400 sometime last week, disabling the ActiveX again. I may stick to the WindowsAPI version of the solution since it isn't affected by the registry change but it is more cumbersome than MSCOMM.
Thanks anyway about the tip about the compatiblity...
The MSCOMM is certainly useful. I've interfaced several minor pieces of lab equipment (balances, titrators) through Excel. Sometimes the vendors provide software but usually it has way more bells and whistles than one needs for routine measurements.
I even interfaced a 20-year old...
I haven't solved the MSCOMM.OCX problem but did find the following website which provides code to do serial communications using WindowsAPI functions. This approach eliminates the need to install and register MSCOMM.OCX
I was able to get this code to work in Excel 2007 with my operating...
I have a spreadsheet I originally created in Excel 2003 which used the MSCOMM control to read data sent to the serial port.
When I upgraded to Excel 2007 this spreadsheet still worked fine. Lately our IT installed some updates on my computer and now this spreadsheet cannot use the MSCOMM...
In Windows XP you have to check your file associations.
Check out :http://support.microsoft.com/kb/307859
Although it looks like you may already have done that. Maybe a path issue?
I'm trying to open an Excel file via a macro. However, I want the user to be able to select the file rather than hardcoding the file as in the command:
Workbooks.Open Filename:= "C:Sample.csv"
Should be easy right? But I can't find it in the VBA help.
I found another way to do this that better suited our needs than OneNote. The formatting than OneNote forced us into didn't fit our needs since that program is more of a NoteBook than a document compilation utility.
We are printing .pdf files and have a program that will allows to combine...
We need to save both graphics and text. Dumping the report as an ASCII file will no work. We've looked at .pdf printer drives but want the ability to combine documents printed at different times from different sources into a single final document. To do this with .pdf would require a copy of...
I'm still working on this problem. It appears that I cannot install only the .mdi printer driver but must have Office ($$$) installed on each PC.
Question: MS has come out with OneNote. It has many of the features I need but likewise I don't want to buy a copy for every laboratory PC. I only...
We have PCs in our offices that have Office installed. The PCS in the lab do not. I would like to use Microsoft Office Document Imaging Printer Driver to create images of reports from the laboratory PCs. However, the only way I can find to install the printer driver is to install the Microsoft...
Thanks. I was missing the Microsoft Comm Control which I use to read data from the serial port. The error probably wasn't the Chr() function but rather later references to the MSComm control.
Not sure why it stopped at the line with Chr() in it. Must be an idiosyncracy of VB.
I never...
I created a spreadsheet with a macro that uses the Chr() function on one PC and when I try to run it on a second PC I get the error
Compile Error: Cant find project or library.
If I create a new worksheet on the new PC and use the Chr() function everything is normal. The error only occurs...
Thanks Combo. Yours worked. I had been putting a period before the 'click'. At various points I had tried "public" as the procedure type and '_' in the calling routine but never together.
Working code is:
'In Sheet1
Public Sub cmdFill_List_Click()
'stuff
End Sub
'In Module2...
I didn't explain well. I have a macro in the button_click() procedure. I want to execute the button_click() procedure from another macro instead of having to reproduce the code again. (although I suppose that could be done, but not efficient).
Matt
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.