Visual Basic Website Where?and How?

KEN_KACEL

Member
Join Date
Nov 2002
Location
NORTH COUNTRY
Posts
162
I COULDN'T FIND THE THREAD THAT HAD A GOOD VISUAL BASIC WEB SITE RECOMMENDATION. CAN YOU POINT ME IN THE RIGHT DIRECTION.

I HAVE BEEN A CONTROLS PROGRAMMER FOR 13 YEARS AND HAVE NOT NEEDED A VISUAL BASIC SKILL. WITH DDE (DYNAMIC DATA EXCHANGE) I HAVE BEEN ABLE TO UPLOAD AND DOWNLOAD PLC BITS AND REGISTERS INTO EXCELL SPREADSHEETS AND WORD, WITH PRETTY GRAPHICS AND HMI LOOK AND FEEL FOR LITTLE COST. BUT I FALL DOWN WHEN THESE CUSTOMERS NEED ARCHIVING. THE VB DRIVER IN EXCELL LOOKS LIKE IT WOULD SAVE SHEETS AND CELLS INTO APPENDED FILES. BUT I DON'T KNOW WHERE TO START FOR A SELF TUTORIAL ON VB OR ARE THERE SOME CANNED ROUTINES I COULD DOWNLOAD AND GROOM?

PS - XLREPORTER BY SYTECH WILL ARCHIVE,STORE DATA BASE,FILES,WEB FORMAT, ECT. BUT IS PRICEE APRX. $1200 TO START DOLLARS AND ALL THE VB CODE IS PROTECTED.

"In a throw away society even the bottom feeders can flourish"
"I have only one regrett, that I have only one life to give to my company"
 
Ken

I not sure if this is the link you saw in a thread on this site, but give this a go anyway Code Guru's Forum They have a VB forum as well as most of the other programming languages.

I visit this forum occasionally as at the moment I am learning VB.Net

Hope this helps, Good luck

Paul
 
1st get your hands on a good Excel VBA book. Then use the macro recorder and let Excel write some macros for you that open and close files. This is a real good way to figure out how all this works and the book can usually fill in the rest. I kind of did the same thing by collecting the data for display in a sheet while showing an Excel graph. If I remember correctly I put all the data I wanted to keep in a seperate sheet with the time and date stamp each time I wrote to the sheet. At the end of the day (or whenever you want) call a routine that opens a new work book and moves the data to the new workbook then give it a unique name like the time and date save and close. If you want I will see if I can dig it up. Might help.
 
bwheat thanks for the macro creator advicce it does put the code in VB. I transfered a block of cells from a DDE sheet opened a new excell file and pasted only values in the special paste to a new file then saved the file and this is what I got:

/code
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 10/8/2003 by Logic Plus, Inc
'

'
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Program Files\XLReporter\XLRoutput\Book2.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub
------------------------------------------------------------
I will get a book to decifer the code. Thanks.

I did lookup the VB web sites and they look promising
 
Hi Ken,

Three things to watch for:

1. Make certain that your DDE sheet is the active workbook, and the active worksheet. This can be done programmatically.

2. "Selection.Copy" is only going to copy the range of data that is currently selected. Make sure you change that code to specify your range explicitly (note - depending on how you specify the range, you can ignore (1) above).

3. "Book2.xls" should be changed to the appropriate string value that you want - something like:

Dim DDESaveFilename as String
DDESaveFilename = Format(Now, "MMDDYYYY") & ".xls"

Then,

ActiveWorkbook.SaveAs Filename:= _
"C:\Program Files\XLReporter\XLRoutput\Book2.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

becomes:

ActiveWorkbook.SaveAs Filename:= _
"C:\Program Files\XLReporter\XLRoutput\" & DDESaveFilename, FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

Good luck,

Marc
 
Here is a little code that I wrote to save the report when you called the routine. It shows how I did the file name thing.


Sub SaveData()
Dim NowTime As String

Application.DisplayAlerts = False
NowTime = Trim(Str(Now))

Application.Workbooks("dataacq.xls").Worksheets("AMPCHANGE").Range("A7").value = 1
'Stop Data Collection during save process.
Application.ActiveWorkbook.Save

For z = 20 To 1 Step -1
answer = Mid(NowTime, z, 1)

If answer <> "/" And answer <> ":" And answer <> " " Then
FileTime = answer + FileTime 'Left(address, z)
End If
Next z

FileTime = FileTime + ".xls"
filestring = "C:\sys4daq\" + FileTime



ChDir "C:\sys4daq"
Application.Workbooks("ANALOGDATA.xls").SaveAs Filename:=filestring, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False

Application.Workbooks(FileTime).Close

Application.Quit
End Sub
 

Similar Topics

Dear experts, I am want to program RS view32 with help of Microsoft visual basic (visual basic editor). But how to start I don't know,please...
Replies
10
Views
2,376
help How do I create Bidirectional Activex Connection Arrows? As per attached photo. How to Create RightoLeft Property in Visual Basic - Activex?
Replies
3
Views
1,655
I'm just trying to load from a text file into a string. I don't get why this doesn't work. Function LoadFile(FileName As String) As String()...
Replies
0
Views
1,548
Hello, Im trying to learn how to use VBA with factorytalk view so i can later design displays using tags from PLCs and im having some trouble...
Replies
2
Views
3,790
Hello there, world! The problem i'm facing up is about a registry I need to do in order to compare the set point versus the real variable I got...
Replies
2
Views
1,578
Back
Top Bottom