Click here to Skip to main content
15,920,508 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionnewbie question Pin
NAB371-Dec-09 17:37
NAB371-Dec-09 17:37 
AnswerRe: newbie question Pin
Andy_L_J1-Dec-09 17:52
Andy_L_J1-Dec-09 17:52 
AnswerRe: newbie question Pin
dan!sh 1-Dec-09 19:03
professional dan!sh 1-Dec-09 19:03 
AnswerRe: newbie question Pin
Luc Pattyn2-Dec-09 1:28
sitebuilderLuc Pattyn2-Dec-09 1:28 
AnswerBuild or Buy Pin
David Mujica2-Dec-09 3:52
David Mujica2-Dec-09 3:52 
QuestionEmbed MS Windows Explorer in Access Form Pin
john john mackey1-Dec-09 7:31
john john mackey1-Dec-09 7:31 
AnswerRe: Embed MS Windows Explorer in Access Form Pin
Eddy Vluggen2-Dec-09 0:56
professionalEddy Vluggen2-Dec-09 0:56 
QuestionVBA in Visual Basic Pin
Sondre Minnesjord1-Dec-09 4:43
Sondre Minnesjord1-Dec-09 4:43 
Hello!

I've got a strange problem with the following piece of code:

Public Sub NodeDispl()

Dim objOpenSTAAD
Dim nNodeNo As Integer
Dim nLC As Integer
Dim pdDisps(6) As Double

Set objOpenSTAAD = CreateObject("OpenSTAAD.Output.1")
objOpenSTAAD.SelectSTAADFile "C:\temp\staadtest.std"

objOpenSTAAD.GetNodeDisplacements 7, 101, pdDisps(0)

objOpenSTAAD.CloseSTAADFile

Set objOpenSTAAD = Nothing

End Sub

The code above is used to read the results from a structural analysis program and works fine in VBA using Excel. The results are stored in the variable pdDisps, which is an array.
However, I'm trying to make a stand-alone application using Visual Basic (2008 Express Edition). When inserting a similar piece of code in VB, only the first value is read - instead of an array of values I get one value and the rest of the elements in the array are zero.

1. Is there any logical explanation for this behaviour?

2. If not, is there a way I can implement VBA code into my VB application?
AnswerRe: VBA in Visual Basic Pin
Dave Kreskowiak1-Dec-09 4:48
mveDave Kreskowiak1-Dec-09 4:48 
GeneralRe: VBA in Visual Basic Pin
Sondre Minnesjord1-Dec-09 4:56
Sondre Minnesjord1-Dec-09 4:56 
GeneralRe: VBA in Visual Basic Pin
Dave Kreskowiak1-Dec-09 5:09
mveDave Kreskowiak1-Dec-09 5:09 
GeneralRe: VBA in Visual Basic Pin
Sondre Minnesjord1-Dec-09 20:17
Sondre Minnesjord1-Dec-09 20:17 
GeneralRe: VBA in Visual Basic Pin
Dave Kreskowiak2-Dec-09 0:38
mveDave Kreskowiak2-Dec-09 0:38 
QuestionRe: VBA in Visual Basic - Pin
Sondre Minnesjord18-Feb-10 21:22
Sondre Minnesjord18-Feb-10 21:22 
AnswerRe: VBA in Visual Basic - Pin
Dave Kreskowiak19-Feb-10 1:42
mveDave Kreskowiak19-Feb-10 1:42 
GeneralRe: VBA in Visual Basic - Pin
Sondre Minnesjord19-Feb-10 2:42
Sondre Minnesjord19-Feb-10 2:42 
GeneralRe: VBA in Visual Basic - Pin
Dave Kreskowiak19-Feb-10 12:52
mveDave Kreskowiak19-Feb-10 12:52 
QuestionVisual Basic 6 Pin
goldenrose91-Dec-09 4:35
goldenrose91-Dec-09 4:35 
AnswerRe: Visual Basic 6 Pin
Dave Kreskowiak1-Dec-09 4:46
mveDave Kreskowiak1-Dec-09 4:46 
GeneralRe: Visual Basic 6 Pin
goldenrose91-Dec-09 6:30
goldenrose91-Dec-09 6:30 
GeneralRe: Visual Basic 6 Pin
The Man from U.N.C.L.E.1-Dec-09 6:42
The Man from U.N.C.L.E.1-Dec-09 6:42 
AnswerRe: Visual Basic 6 Pin
EliottA1-Dec-09 4:48
EliottA1-Dec-09 4:48 
GeneralRe: Visual Basic 6 Pin
Shameel1-Dec-09 7:14
professionalShameel1-Dec-09 7:14 
AnswerRe: Visual Basic 6 Pin
Christian Graus1-Dec-09 5:29
protectorChristian Graus1-Dec-09 5:29 
GeneralRe: Visual Basic 6 Pin
Shameel1-Dec-09 7:15
professionalShameel1-Dec-09 7:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.