Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB6 - Copy to clipboard all MSFlexgrid 1 cells

Posted on 2014-03-08
13
Medium Priority
?
1,165 Views
Last Modified: 2014-03-08
Hi all

I would like to copy to clipboard just by double clicking in the grid all cells.

Is there a way to do this? can i also copy to clip board so that when i past it, it as borders for all cells value?

Thanks again
0
Comment
Question by:Wilder1626
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 49

Expert Comment

by:Martin Liss
ID: 39915173
Do you want a picture of the grid or do you want the data? If you want the data, does it matter to you how it is stored?
0
 
LVL 11

Author Comment

by:Wilder1626
ID: 39915190
I was already using the picture as below:

Clipboard.clear
Clipboard.SetData CaptureForm(Me)

Open in new window


But i would like to have it as DATA.

If i can keep the same look as in the grid, that would be the best way.

Just like a spreadsheet look.

Is that possible?
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 39915210
No, I don't believe that that is possible. You can store the data as, say, a CSV file but you would have to use code to bring the data back into the grid (if that's what you want to do). Actually it would help if you could describe exactly what you want to accomplish. I know you said "it as borders for all cells value" but I'm not sure what that means.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 11

Author Comment

by:Wilder1626
ID: 39915227
What i wanted to do is something like this:

Let say that in the grid, i have:
grid value
so when i would click inside the grid, it would be able to copy the content of the grid in the same look and format to past it in an email for example:
final result
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 39915230
OK now I understand. What was wrong with using a picture?
0
 
LVL 11

Author Comment

by:Wilder1626
ID: 39915233
i need the email receiver to be able to copy paste the data of the email so that they don't type it manually in a request form, and at the same time have the risk of any typo that could create system error.
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 39915239
I don't believe you can do that but let me ask you one more question. What does the user paste the data into? Another flexgrid? Or Excel? Or?
0
 
LVL 11

Author Comment

by:Wilder1626
ID: 39915242
They past it into an Excel form
0
 
LVL 49

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 39915251
Here then is the only way that I can think of that will allow you to do what you want.

1. Open Excel from your VB6 app and create a new workbook
2. Write the data to a sheet in the workbook
3. Using code, append that sheet as an attachment to the email. (I've done this so I can help)
4. After your user saves the attachment, use code (that you'll have to add) to grab the data from the sheet and either paste into into a sheet in users workbook or into his form.
0
 
LVL 11

Author Comment

by:Wilder1626
ID: 39915262
Let me think here a little more.

I'm also thinking that i can use a List box with the information's

Ex:
  List1.AddItem "Rate already in TMS"
    List1.AddItem ""
    List1.AddItem "Carrier ID: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 0)
    List1.AddItem "From origin: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 1)
    List1.AddItem "To destination: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 3)
    List1.AddItem "Effective date: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 5)
    List1.AddItem "Service com.: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 6)
    List1.AddItem "Invalid date: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 14)
    List1.AddItem "Rate group: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 15)
    List1.AddItem "Radial rate: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 16)
    List1.AddItem "Radial rate max stop(s): " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 17)
    List1.AddItem "Variable rate: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 22)
    List1.AddItem "Rate type: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 23)
    List1.AddItem "Fix charge: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 24)
    List1.AddItem "Unload rate: " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 27)
    List1.AddItem "Max stop(s): " & MSHFlexGrid_effective_rates.TextMatrix(MSHFlexGrid_effective_rates.Row, 28)
    List1.AddItem ""
    List1.AddItem "-------------------------------------------"

Open in new window

0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 39915280
OK, I'm a bit confused about how that helps but let me know if I can do anything more for you.
0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 39915343
Thanks a lot for your help. I will get both options. Yours with the sheet as an attachment if i have multiple records in the grid and if i only have 1 row of data, i will use the list box details that would give me a result like this as an examp:

Carrier ID: H&RTRAN
From origin: BRANDON
To destination: T3J 4X7
Effective date: 20130521
Service com.: SINGLE
Invalid date: 20150422
Rate group: 004-19-1977
Radial rate:
Radial rate max stop(s): 5
Variable rate: 2.24
Rate type: Per mile
Fix charge: .00
Unload rate: 2.24
Max stop(s): 7



Thanks again for all your help.
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 39915356
You're welcome.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question