473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Socket Programming in VBA

Hi,

I am trying to create a software which has client-server model. Is there any way to make two separate excel sheets talk to each other?
The current version is in C++ which uses a server and a client method based on ip and port number. Can we do something similar in VBA?


Thanks,
Han Nan
Jul 6 '10 #1
6 1638
maxamis4
295 Expert 100+
Just to give you an idea if it is Microsoft it can talk to it. My question is to you is how much coding experience do you have with VBA.

If you look at this snippet of code it will give you an idea of what to do:

Expand|Select|Wrap|Line Numbers
  1. Dim cn as ADODB.Connection
  2. Set cn = New ADODB.Connection
  3. With cn
  4.     .Provider = "Microsoft.Jet.OLEDB.4.0"
  5.     .ConnectionString = "Data Source=C:\MyFolder\MyWorkbook.xls;" & _
  6. "Extended Properties=Excel 8.0;"
  7.     .Open
  8. End With
  9.  
  10.  
Jul 7 '10 #2
@maxamis4
Hi,

Thanks for the code.
I am getting User-type not defined at "cn As ADODB.Connection".
Also, this is just to establish a connection. What I want to do is say from sheet 1 I pass a string "Hi this is me". and in sheet 2 I received a message with option OK & Cancel and update this message to the selected row.
Any idea how to do this??

Please help.

Thanks,
Han Nan
Jul 7 '10 #3
MrDeej
157 100+
You need to make a reference for "Microsoftf Activex Data objects " in the VBA windows
Jul 8 '10 #4
Oralloy
988 Expert 512MB
Just a quick thought ... why are you even trying to network this?

If the sheets are on the same computer, just have the first one open the second under excel, and then execute methods that live in that sheet? Easy Peasey.

If you need a more complex interaction or an actual client/server model over the network, let us know.
Jul 8 '10 #5
Hi,

The excel sheets may or may not be on the same computer...so if there is a person in Location A and another person in Location B logging on to the same server then how do we tackle this situation?

Thanks,
Han Nan
Jul 8 '10 #6
Oralloy
988 Expert 512MB
Han,

(Or, should I address you as Nan?)

Hopefully you have a good idea of how to craft a client-server system. It's not difficult, but the devil is in the details.

You might want to look at this article:
http://www.osix.net/modules/article/?id=25
As a starting point.

Luck!
Jul 8 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rob | last post by:
Hello, I've got a huge problem with async sockets. I've created a networked virtual environment, using async socket programming. The problem I face occurs when I close the listener socket. It...
2
by: Jean-Philippe Guyon | last post by:
Hello, I am trying to compile a class that uses socket using the Visual C++ ..NET compiler. I get the following error: ------ Build started: Project: infCommon, Configuration: Release Win32...
4
by: Ted | last post by:
Hi all, I am trying to learn C socket programming and I have a small program which is a UP client. The problem is, when I run the program, I get a runtime error - "Invalid Argument" - from a...
2
by: chellappa | last post by:
Hi Every body!, i did a small Chat program in Linux C Socket Programm ... I am using stdout/stdin i did in single machinee i will work properly..but i want to run in differnet machine..i tried...
5
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose...
1
by: John Sheppard | last post by:
Thanks to everyone that responded to my previous Socket Programming question. Now I have run into some behavior that I don't quite understand. Programming environment. VS.NET 2003, C#, Windows...
9
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am...
4
by: Marco Meoni | last post by:
Hi. I read the Gordon McMillan's "Socket Programming Howto". I tried to use the example in this howto but this doesn't work. The code is class mysocket: '''classe solamente dimostrativa -...
8
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi all, I am new to .net technologies. ASP.NET supports socket programming like send/receive in c or c++? I am developing web-site application in asp.net and code behind is Visual C#. In...
1
by: phpuser123 | last post by:
I just started socket programming in java.I read a few tutorial and came up with the following script import java.net.*; public class socket { /** * @param args */ public static...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.