Click here to Skip to main content
15,887,485 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionAccessing an external DLL from a Timer - should there be a problem? Pin
Peter R. Fletcher23-Apr-14 11:39
Peter R. Fletcher23-Apr-14 11:39 
AnswerRe: Accessing an external DLL from a Timer - should there be a problem? Pin
Dave Kreskowiak23-Apr-14 12:32
mveDave Kreskowiak23-Apr-14 12:32 
GeneralRe: Accessing an external DLL from a Timer - should there be a problem? Pin
Peter R. Fletcher23-Apr-14 12:48
Peter R. Fletcher23-Apr-14 12:48 
AnswerRe: Accessing an external DLL from a Timer - should there be a problem? Pin
Bernhard Hiller23-Apr-14 22:35
Bernhard Hiller23-Apr-14 22:35 
GeneralRe: Accessing an external DLL from a Timer - should there be a problem? Pin
Peter R. Fletcher24-Apr-14 3:17
Peter R. Fletcher24-Apr-14 3:17 
AnswerRe: Accessing an external DLL from a Timer - should there be a problem? Pin
Bernhard Hiller24-Apr-14 21:15
Bernhard Hiller24-Apr-14 21:15 
GeneralRe: Accessing an external DLL from a Timer - should there be a problem? Pin
Peter R. Fletcher25-Apr-14 5:49
Peter R. Fletcher25-Apr-14 5:49 
QuestionExcel VBA Macro ' Run-time error '9': Subscript out of range ' Pin
Deimantas23-Apr-14 0:53
Deimantas23-Apr-14 0:53 
Hi all. First of all I know that there are a lot of questions like mine, but I just can't solve it.
Secondly, this app have to export XML format from spritesheet to a file.
What I did is just create a simple button, added Macro and pasted this code into:

VB
Sub ExportXML()

Const ForReading = 1
Const ForWriting = 2

Set objFSO = CreateObject("Scripting.FileSystemObject")

newFileName = Application.GetSaveAsFilename("out.xml", "XML Files (*.xml), *.xmls")
If newFileName = False Then
Exit Sub
End If
If objFSO.FileExists(newFileName) Then
objFSO.DeleteFile (newFileName)
End If
ActiveWorkbook.XmlMaps("Root_Map").Export URL:=newFileName


Set objFile = objFSO.OpenTextFile(newFileName, ForReading)


Dim count
count = 0
Do Until objFile.AtEndOfStream
 strLine = objFile.ReadLine
 If count = 0 Then
    strNewContents = strNewContents & "<?xml version=""1.0"" ?>" & vbCrLf
ElseIf count = 1 Then
    strNewContents = strNewContents & "<Root xmlns=""http://tempuri.org/import.xsd"">" & vbCrLf
Else
    strNewContents = strNewContents & strLine & vbCrLf
End If
count = count + 1

Loop

objFile.Close

Set objFile = objFSO.OpenTextFile(newFileName, ForWriting)
 objFile.Write strNewContents

objFile.Close
End Sub


When I have a basic table with data and a button, which when I press it, I get to the Save As screen. I save it as "out.xml" in my Desktop, but I when press OK, i got and error saying : " Run-time error '9': Subscript out of range ' ", and this
VB
ActiveWorkbook.XmlMaps("Root_Map").Export URL:=newFileName
line becomes yellow. What I am doing wrong in here? Thank you very much and appreciate any help from you guys Smile | :) .
AnswerRe: Excel VBA Macro ' Run-time error '9': Subscript out of range ' Pin
Richard Deeming23-Apr-14 1:23
mveRichard Deeming23-Apr-14 1:23 
GeneralRe: Excel VBA Macro ' Run-time error '9': Subscript out of range ' Pin
Deimantas23-Apr-14 1:33
Deimantas23-Apr-14 1:33 
GeneralRe: Excel VBA Macro ' Run-time error '9': Subscript out of range ' Pin
Richard Deeming23-Apr-14 1:38
mveRichard Deeming23-Apr-14 1:38 
GeneralRe: Excel VBA Macro ' Run-time error '9': Subscript out of range ' Pin
Deimantas25-Apr-14 8:45
Deimantas25-Apr-14 8:45 
QuestionVariable Question Pin
DJHJr21-Apr-14 4:33
DJHJr21-Apr-14 4:33 
AnswerRe: Variable Question Pin
Eddy Vluggen21-Apr-14 8:15
professionalEddy Vluggen21-Apr-14 8:15 
GeneralRe: Variable Question Pin
DJHJr21-Apr-14 10:10
DJHJr21-Apr-14 10:10 
GeneralRe: Variable Question Pin
Wes Aday21-Apr-14 11:47
professionalWes Aday21-Apr-14 11:47 
GeneralRe: Variable Question Pin
DJHJr21-Apr-14 13:09
DJHJr21-Apr-14 13:09 
GeneralRe: Variable Question Pin
Wes Aday21-Apr-14 13:14
professionalWes Aday21-Apr-14 13:14 
GeneralRe: Variable Question Pin
DJHJr21-Apr-14 13:17
DJHJr21-Apr-14 13:17 
GeneralRe: Variable Question Pin
DJHJr28-Apr-14 6:22
DJHJr28-Apr-14 6:22 
Questionrunning AxAcroPDF in a dialog, right choice or not Pin
jkirkerx20-Apr-14 9:49
professionaljkirkerx20-Apr-14 9:49 
QuestionHelp... Again... Pin
Member 1072866720-Apr-14 6:42
Member 1072866720-Apr-14 6:42 
AnswerRe: Help... Again... Pin
Member 1072866720-Apr-14 6:44
Member 1072866720-Apr-14 6:44 
GeneralRe: Help... Again... Pin
Wes Aday20-Apr-14 7:03
professionalWes Aday20-Apr-14 7:03 
GeneralRe: Help... Again... Pin
Member 1072866720-Apr-14 8:13
Member 1072866720-Apr-14 8:13 

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.