ExcelWkbk is closed and can't be saved. After Close():
Set ExcelWkbk = ExcelApp.Workbooks.Open(xlsFileSpec);
The open method returns a workbook object - it's not the same as the previous one.
> On the PDA APP - maybe if the product
> takes off you would consider a paying
> job to write for me?
Absolutely. I've got everything I need to produce CE or Mobile apps.
-SHAWN-
---
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".
Set ExcelWkbk = ExcelApp.Workbooks.Open(xlsFileSpec);
The open method returns a workbook object - it's not the same as the previous one.
> On the PDA APP - maybe if the product
> takes off you would consider a paying
> job to write for me?
Absolutely. I've got everything I need to produce CE or Mobile apps.
-SHAWN-
---
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".
> the code, which would cause it not to
> run correctly, as described, please?
If Open fails for any reason, Workbooks(1) doesn't exist. Set
ExcelWbk=ExcelApp.Workbooks(1) will fail with index out of bounds.
Set app = CreateObject("Excel.Application");
app.Visible = True;
Set wbk = app.Workbooks.Open(xlsFileSpec);
Set wks = wbk.Worksheets(1); //<--That's dangerous.
wbk.Worksheets(1).WindowState = xlMinimized;
wks.EnableCalculation = True;
app.WindowState = xlMinimized;
This is also dangerous though. It's assumed that the file contains at least
one worksheet object. Same problem: index out of bounds. You can use Count
(Workbooks.Count, Worksheets.Count) to make sure 1 is a valid index.
> Any ideas how I can communicate with COM1
> on the PC without having to use the Agilent
> I/O libraries
You can use Microsoft COMM ActiveX control:
Set comm = CreateObject("MSCommLib.MSComm");
comm.Port = 1
comm.Settings = "9600,N,8,1"
comm.InputLen = 0
comm.PortOpen = True
That's it. Send data with comm.Output = (string or byte array). Receive with
property comm.Input. Test for input with property comm.InputLen. It's really
easy. The library is redistributable (in particular, mscomm32.ocx is an
extended use redistributable), so there's no charge for using it in a run
time environment. The method of redistribution is up to you also (at least
last time I read the license it was). You don't necessarily have to ship the
whole setup package along with your stuff. It's usually sufficient to plop
the .ocx in the system directory and register it (no dll hell with this
one).
To test if you need to install the control, Attempt to open the registry key
HKCRMSCommLib.MSComm. If it fails, copy mscomm32.ocx to
getEnvironment("SystemRoot") and execute PC regedt32 mscomm32.ocx.
[RE: VEE, PDAs etc]
> I would also like to have an application above
> on a PDA but I know this is not possible with VEE.
Give it another five years or so - you'll be amazed. Until amazing things
happen in the future though, this is a little specific to the PDA. What
operating system? That will dictate your choice of tools. If you target
Windows CE or Mobile devices, then you have a whole range of options.
There's Embedded VB and Visual Studio can compile for handheld devices.
There are emulation environments and a whole slew of stuff. See:
http://msdn.microsoft.com/mobility/
http://msdn.microsoft.com/embedded/
-SHAWN-
---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".